diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 533c2f9151..6140babecd 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,6 +10,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](acorn/acorn.d.ts) [Acorn](https://github.com/marijnh/acorn) by [RReverser](https://github.com/RReverser) * [:link:](rails-actioncable/rails-actioncable.d.ts) [ActionCable](https://github.com/rails/rails/tree/master/actioncable) by [Vincent Zhu](https://github.com/zhu1230) * [:link:](cordova-plugin-ms-adal/cordova-plugin-ms-adal.d.ts) [Active Directory Authentication Library plugin for Apache Cordova](https://github.com/AzureAD/azure-activedirectory-library-for-cordova) by [Kai Walter](https://github.com/KaiWalter) +* [:link:](adal-angular/adal-angular.d.ts) [ADAL.JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) by [mmaitre314](https://github.com/mmaitre314) +* [:link:](adal-angular/adal.d.ts) [ADAL.JS](https://github.com/AzureAD/azure-activedirectory-library-for-js) by [mmaitre314](https://github.com/mmaitre314) * [: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), [Abner Oliveira](https://github.com/abner) * [:link:](ag-grid/ag-grid.d.ts) [ag-grid](http://www.ag-grid.com) by [Niall Crosby](https://github.com/ceolter) @@ -38,6 +40,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angularjs/angular-component-router.d.ts) [Angular JS 1.5 component router](http://angularjs.org) by [David Reher](http://github.com/davidreher) * [:link:](angular-meteor/angular-meteor.d.ts) [Angular JS Meteor (angular.meteor module)](https://github.com/Urigo/angular-meteor) by [Peter Grman](https://github.com/pgrm) * [:link:](angular-locker/angular-locker.d.ts) [Angular Locker](https://github.com/tymondesigns/angular-locker) by [Niko Kovačič](https://github.com/nkovacic) +* [:link:](angular-media-queries/match-media.d.ts) [Angular matchMedia (angular.matchMedia module)](https://github.com/jacopotarantino/angular-match-media) by [Joao Monteiro](https://github.com/jpmnteiro) * [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham) * [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) @@ -55,8 +58,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-environment/angular-environment.d.ts) [angular-environment](https://github.com/juanpablob/angular-environment) by [Matt Wheatley](https://github.com/terrawheat) * [:link:](angular-formly/angular-formly.d.ts) [angular-formly](https://github.com/formly-js/angular-formly) by [Scott Hatcher](https://github.com/scatcher) * [:link:](angular-gettext/angular-gettext.d.ts) [angular-gettext](https://angular-gettext.rocketeer.be) by [Ákos Lukács](https://github.com/AkosLukacs) -* [:link:](angular-google-analytics/angular-google-analytics-service.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Matt Wheatley](https://github.com/terrawheat) * [:link:](angular-google-analytics/angular-google-analytics.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](angular-google-analytics/angular-google-analytics-service.d.ts) [angular-google-analytics](https://github.com/revolunet/angular-google-analytics) by [Matt Wheatley](https://github.com/terrawheat) * [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners) * [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame) * [:link:](angular-httpi/angular-httpi.d.ts) [angular-httpi](https://github.com/bennadel/httpi) by [Andrew Camilleri](https://github.com/Kukks) @@ -68,6 +71,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-modal/angular-modal.d.ts) [angular-modal](https://github.com/btford/angular-modal) by [Paul Lessing](https://github.com/paullessing) * [:link:](angular-notifications/angular-notifications.d.ts) [angular-notifications](https://github.com/DerekRies/angular-notifications) by [Tomasz Ducin](https://github.com/ducin/DefinitelyTyped) * [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) +* [:link:](angular-permission/angular-permission.d.ts) [angular-permission](https://github.com/Narzerus/angular-permission) by [Voislav Mishevski](https://github.com/vmishevski) * [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) * [:link:](angular-signalr-hub/angular-signalr-hub.d.ts) [angular-signalr-hub](https://github.com/JustMaier/angular-signalr-hub) by [Adam Santaniello](https://github.com/AdamSantaniello) * [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) @@ -86,11 +90,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](animation-frame/animation-frame.d.ts) [animation-frame](https://github.com/kof/animation-frame) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](ansi-styles/ansi-styles.d.ts) [ansi-styles](https://github.com/sindresorhus/ansi-styles) by [bryn austin bellomy](https://github.com/brynbellomy) * [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten) -* [:link:](antd/antd.d.ts) [Antd](http://ant.design) by [bang88](https://github.com/bang88) +* [:link:](antd/antd.d.ts) [Antd](http://ant.design) by [bang88](https://github.com/bang88), [Bruce Mitchener](https://github.com/waywardmonkeys) * [: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:](anydb-sql/anydb-sql.d.ts) [anydb-sql](https://github.com/doxout/anydb-sql) by [Gorgi Kosev](https://github.com/spion) * [:link:](anydb-sql-migrations/anydb-sql-migrations.d.ts) [anydb-sql-migrations](https://github.com/spion/anydb-sql-migrations) by [Gorgi Kosev](https://github.com/spion) +* [:link:](cordova-plugin-background-mode/cordova-plugin-background-mode.d.ts) [Apache Background Mode plugin](https://github.com/katzer/cordova-plugin-background-mode) by [Paul Thiel](https://github.com/Lordnoname) * [: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:](api-error-handler/api-error-handler.d.ts) [api-error-handler](https://github.com/expressjs/api-error-handler) by [Tanguy Krotoff](https://github.com/tkrotoff) @@ -244,19 +249,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik) * [:link:](classnames/classnames.d.ts) [classnames](https://github.com/JedWatson/classnames) by [Dave Keen](http://www.keendevelopment.ch), [Adi Dahiya](https://github.com/adidahiya), [Jason Killian](https://github.com/JKillian) +* [:link:](cldr.js/cldr.js-event.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim) * [:link:](cldr.js/cldr.js-supplemental.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim) * [:link:](cldr.js/cldr.js.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim), [Grégoire Castre](https://github.com/gcastre) -* [:link:](cldr.js/cldr.js-event.d.ts) [Cldr.js](https://github.com/rxaviers/cldrjs) by [Raman But-Husaim](https://github.com/RamanBut-Husaim) * [:link:](clean-css/clean-css.d.ts) [clean-css](https://github.com/jakubpawlowicz/clean-css) by [Tanguy Krotoff](https://github.com/tkrotoff) +* [:link:](cli/cli.d.ts) [cli](https://www.npmjs.com/package/cli) by [Klaus Reimer](https://github.com/kayahr) * [:link:](cli-color/cli-color.d.ts) [cli-color](https://github.com/medikoo/cli-color) by [Joel Spadin](https://github.com/ChaosinaCan) * [:link:](clipboard/clipboard.d.ts) [clipboard.js](https://github.com/zenorocha/clipboard.js) by [Andrei Kurosh](https://github.com/impworks) * [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) * [:link:](closure-compiler/closure-compiler.d.ts) [closure-compiler](https://github.com/tim-smart/node-closure) by [Martin Probst](https://github.com/mprobst) +* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) +* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) * [:link:](codemirror/codemirror-runmode.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Joseph Vaughan](https://github.com/Joev-) * [:link:](codemirror/searchcursor.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt) * [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) -* [:link:](codemirror/codemirror-showhint.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [jacqt](https://github.com/jacqt), [basarat](https://github.com/basarat) -* [:link:](codemirror/codemirror-matchbrackets.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [Sixin Li](https://github.com/sixinli) * [:link:](coffeeify/coffeeify.d.ts) [coffeeify](https://github.com/jnordberg/coffeeify) by [Qubo](https://github.com/tkQubo) * [:link:](colorbrewer/colorbrewer.d.ts) [colorbrewer](https://github.com/jeanlauliac/colorbrewer) by [Matt Traynham](https://github.com/mtraynham) * [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds) @@ -308,6 +314,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk) * [:link:](credential/credential.d.ts) [credential](https://github.com/ericelliott/credential) by [Phú](https://github.com/phuvo) * [:link:](cron/cron.d.ts) [cron](https://www.npmjs.com/package/cron) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](cropperjs/cropperjs.d.ts) [cropperjs](https://github.com/fengyuanchen/cropperjs) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](cross-storage/cross-storage.d.ts) [cross-storage](https://github.com/zendesk/cross-storage) by [Daniel Chao](http://dchao.co) * [:link:](crossfilter/crossfilter.d.ts) [CrossFilter](https://github.com/square/crossfilter) by [Schmulik Raskin](https://github.com/schmuli) * [:link:](crossroads/crossroads.d.ts) [Crossroads.js](http://millermedeiros.github.io/crossroads.js) by [Diullei Gomes](https://github.com/diullei) @@ -369,13 +376,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](dot-case/dot-case.d.ts) [dot-case](https://github.com/blakeembrey/dot-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](dot-prop/dot-prop.d.ts) [dot-prop](https://github.com/sindresorhus/dot-prop) by [Sam Verschueren](https://github.com/samverschueren) * [:link:](dotdotdot/dotdotdot.d.ts) [dotdotdot](http://dotdotdot.frebsite.nl) by [Milan Jaros](https://github.com/milanjaros) +* [:link:](dotenv/dotenv.d.ts) [dotenv](https://github.com/motdotla/dotenv) by [Jussi Kinnula](https://github.com/jussikinnula) * [:link:](doublearray/doublearray.d.ts) [doublearray](https://github.com/takuyaa/doublearray) by [MIZUSHIMA Junki](https://github.com/mzsm) * [:link:](draft-js/draft-js.d.ts) [draft-js](https://github.com/facebook/draft-js) by [Pavel Evsegneev](https://github.com/Ahineya) -* [:link:](hystrixjs/hystrixjs.d.ts) [dragula](https://bitbucket.org/igor_sechyn/hystrixjs) by [Igor Sechyn](https://github.com/igorsechyn) * [:link:](dragula/dragula.d.ts) [dragula](http://bevacqua.github.io/dragula) by [Paul Welter](https://github.com/pwelter34) +* [:link:](hystrixjs/hystrixjs.d.ts) [dragula](https://bitbucket.org/igor_sechyn/hystrixjs) by [Igor Sechyn](https://github.com/igorsechyn) * [:link:](drop/drop.d.ts) [Drop](http://github.hubspot.com/drop) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments) -* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com), [Vasya Aksyonov](https://github.com/outring) +* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo), [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com), [Vasya Aksyonov](https://github.com/outring), [Simon Huber](https://github.com/renuo) * [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io) * [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com) * [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire) @@ -394,8 +402,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) * [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) -* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io) +* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io), [Milan Burda](https://github.com/miniak) * [:link:](electron-builder/electron-builder.d.ts) [electron-builder](https://github.com/loopline-systems/electron-builder) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](electron-json-storage/electron-json-storage.d.ts) [electron-json-storage](https://github.com/jviotti/electron-json-storage) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](electron-packager/electron-packager.d.ts) [electron-packager](https://github.com/maxogden/electron-packager) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](github-electron/electron-prebuilt.d.ts) [electron-prebuilt](https://github.com/mafintosh/electron-prebuilt) by [rhysd](https://github.com/rhysd) * [:link:](electron-window-state/electron-window-state.d.ts) [electron-window-state](https://github.com/mawie81/electron-window-state) by [rhysd](https://github.com/rhysd) @@ -407,19 +416,23 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame) * [:link:](empower/empower.d.ts) [empower](https://github.com/twada/empower) by [vvakame](https://github.com/vvakame) * [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki) +* [:link:](encoding-japanese/encoding-japanese.d.ts) [encoding-japanese](https://github.com/polygonplanet/encoding.js) by [rhysd](https://rhysd.github.io) * [:link:](envify/envify.d.ts) [envify](https://github.com/hughsk/envify) by [Qubo](https://github.com/tkQubo) * [:link:](enzyme/enzyme.d.ts) [Enzyme](https://github.com/airbnb/enzyme) by [Marian Palkus](https://github.com/MarianPalkus), [Cap3](http://www.cap3.de) * [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](eq.js/eq.js.d.ts) [eq.js](https://github.com/Snugug/eq.js) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) +* [:link:](error-stack-parser/error-stack-parser.d.ts) [ErrorStackParser](https://github.com/stacktracejs/error-stack-parser) by [Eric Wendelin](https://www.eriwen.com) * [:link:](es6-collections/es6-collections.d.ts) [es6-collections](https://github.com/WebReflection/es6-collections) by [Ron Buckton](http://github.com/rbuckton) * [: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:](es6-shim/es6-shim.d.ts) [es6-shim](https://github.com/paulmillr/es6-shim) by [Ron Buckton](http://github.com/rbuckton) +* [:link:](escape-html/escape-html.d.ts) [escape-html](https://github.com/component/escape-html) by [Elisée MAURER](https://github.com/elisee) * [:link:](escape-latex/escape-latex.d.ts) [escape-latex](https://github.com/dangmai/escape-latex) by [Oliver Schneider](https://github.com/olsio) * [:link:](escape-string-regexp/escape-string-regexp.d.ts) [escape-string-regexp](https://github.com/sindresorhus/escape-string-regexp) by [kruncher](https://github.com/kruncher) * [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis), [RReverser](https://github.com/RReverser) * [:link:](estree/flow.d.ts) [ESTree AST extensions for Facebook Flow](https://github.com/estree/estree) by [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:](evaporate/evaporate.d.ts) [EvaporateJS](https://github.com/TTLabs/EvaporateJS) by [Andrew Kuklewicz](https://github.com/kookster), [Chris Rhoden](https://github.com/chrisrhoden) * [:link:](event-kit/event-kit.d.ts) [event-kit](https://github.com/atom/event-kit) by [Vadim Macagon](https://github.com/enlight) * [: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:](event-stream/event-stream.d.ts) [event-stream](https://github.com/dominictarr/event-stream) by [David Gardiner](https://github.com/flcdrg) @@ -430,8 +443,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](expect/expect.d.ts) [Expect](https://github.com/mjackson/expect) by [Justin Reidy](https://github.com/jmreidy) * [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/Automattic/expect.js) by [Teppei Sato](https://github.com/teppeis) * [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) -* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](express-serve-static-core/express-serve-static-core.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](express-brute/express-brute.d.ts) [express-brute](https://github.com/AdamPflug/express-brute) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](express-brute-memcached/express-brute-memcached.d.ts) [express-brute-memcached](https://github.com/AdamPflug/express-brute-memcached) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](express-brute-mongo/express-brute-mongo.d.ts) [express-brute-mongo](https://github.com/auth0/express-brute-mongo) by [Cyril Schumacher](https://github.com/cyrilschumacher) @@ -447,6 +460,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](express-route-fs/express-route-fs.d.ts) [express-route-fs](https://github.com/kripod/express-route-fs) by [Kristóf Poduszló](https://github.com/kripod) * [:link:](express-session/express-session.d.ts) [express-session](https://www.npmjs.org/package/express-session) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](express-unless/express-unless.d.ts) [express-unless](https://www.npmjs.org/package/express-unless) by [Wonshik Kim](https://github.com/wokim) +* [:link:](express-useragent/express-useragent.d.ts) [express-useragent](https://www.npmjs.org/package/express-useragent) by [Isman Usoh](https://github.com/isman-usoh) * [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de) * [:link:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners) * [:link:](wiiu/wiiu.d.ts) [Extended Functionality of Wii U Internet Browser](https://www.nintendo.co.jp/wiiu/hardware/internetbrowser/extended_functionality.html) by [MIZUSHIMA Junki](https://github.com/mzsm) @@ -457,6 +471,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](fbemitter/fbemitter.d.ts) [Facebook's EventEmitter](https://github.com/facebook/emitter) by [kmxz](https://github.com/kmxz) * [:link:](faker/faker.d.ts) [faker](http://marak.com/faker.js) by [Bas Pennings](https://github.com/basp), [Yuki Kokubun](https://github.com/Kuniwak) +* [:link:](falcor/falcor-browser.d.ts) [falcor](http://netflix.github.io/falcor) by [Quramy](https://github.com/Quramy) +* [:link:](falcor/falcor.d.ts) [falcor](http://netflix.github.io/falcor) by [Quramy](https://github.com/Quramy) +* [:link:](falcor-express/falcor-express.d.ts) [falcor-express](https://github.com/Netflix/falcor-express) by [Quramy](https://github.com/Quramy) +* [:link:](falcor-http-datasource/falcor-http-datasource.d.ts) [falcor-http-datasource](https://github.com/Netflix/falcor-http-datasource) by [Quramy](https://github.com/Quramy) +* [:link:](falcor-json-graph/falcor-json-graph.d.ts) [falcor-json-graph](https://github.com/Netflix/falcor-json-graph) by [Quramy](https://github.com/Quramy) +* [:link:](falcor-router/falcor-router.d.ts) [falcor-router](https://github.com/Netflix/falcor-router) by [Quramy](https://github.com/Quramy) * [:link:](famous/famous.d.ts) [Famous Engine](http://famous.org) by [Boris Vasilenko](https://github.com/borisvasilenko) * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) * [:link:](farbtastic/farbtastic.d.ts) [Farbtastic: jQuery Color Wheel](http://mattfarina.github.io/farbtastic) by [Matt Brooks](https://github.com/EnableSoftware) @@ -472,6 +492,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](filesystem/filesystem.d.ts) [File System API](http://www.w3.org/TR/file-system-api) by [Kon](http://phyzkit.net) * [:link:](file-url/file-url.d.ts) [file-url](https://github.com/sindresorhus/file-url) by [MEDIA CHECK s.r.o.](http://www.mediacheck.cz) * [:link:](FileSaver/FileSaver.d.ts) [FileSaver.js](https://github.com/eligrey/FileSaver.js) by [Cyril Schumacher](https://github.com/cyrilschumacher) +* [:link:](filesize/filesize.d.ts) [filesize](https://github.com/avoidwork/filesize.js) by [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) * [:link:](finalhandler/finalhandler.d.ts) [finalhandler](https://github.com/pillarjs/finalhandler) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](Finch/Finch.d.ts) [Finch](https://github.com/stoodder/finchjs) by [David Sichau](https://github.com/DavidSichau) * [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds), [Nathan Brown](https://github.com/ngbrown) @@ -507,8 +528,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](foundation-sites/foundation-sites.d.ts) [Foundation Sites](http://foundation.zurb.com) by [Sam Vloeberghs](https://github.com/samvloeberghs) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) * [:link:](freedom/freedom-core-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) -* [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) * [:link:](freedom/freedom.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](freedom/freedom-module-env.d.ts) [freedom](https://github.com/freedomjs/freedom) by [Jonathan Pevarnek](https://github.com/jpevarnek) +* [:link:](freeport/freeport.d.ts) [freeport](https://github.com/daaku/nodejs-freeport) by [Arne Schubert](https://github.com/atd-schubert) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fromjs/fromjs.d.ts) [fromjs](https://github.com/suckgamony/fromjs) by [Glenn Dierckx](https://github.com/glenndierckx) * [:link:](fromnow/fromnow.d.ts) [fromnow](https://github.com/lukeed/fromNow) by [Martin Bukovics](https://github.com/marinewater) @@ -544,33 +566,33 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](goJS/goJS.d.ts) [GoJS](http://gojs.net) by [Northwoods Software](https://github.com/NorthwoodsSoftware) * [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) * [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) -* [:link:](google-apps-script/google-apps-script.document.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.content.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.contacts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.charts.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.optimization.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.maps.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.calendar.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.cache.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.base.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.script.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.jdbc.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.gmail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.forms.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.html.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.xml-service.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.utilities.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.url-fetch.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.script.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.ui.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.jdbc.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.drive.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.spreadsheet.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.mail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.html.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.groups.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.gmail.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.types.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.properties.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.language.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.forms.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.spreadsheet.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google-apps-script/google-apps-script.sites.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.xml-service.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.base.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.cache.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.calendar.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) -* [:link:](google-apps-script/google-apps-script.lock.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.properties.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.document.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.optimization.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.groups.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) +* [:link:](google-apps-script/google-apps-script.drive.d.ts) [Google Apps Script 2015-11-12](https://developers.google.com/apps-script) by [motemen](https://github.com/motemen) * [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) * [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](googlemaps/google.maps.d.ts) [Google Maps JavaScript API](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk), [Chris Wrench](https://github.com/cgwrench) @@ -583,6 +605,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](google-closure-compiler/google-closure-compiler.d.ts) [google-closure-compiler](https://github.com/chadkillingsworth/closure-compiler-npm) by [Evan Martin](http://neugierig.org) * [:link:](google-maps/google-maps.d.ts) [google-maps](https://www.npmjs.com/package/google-maps) by [Deividas Bakanas](https://github.com/DeividasBakanas), [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) * [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) * [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) @@ -590,13 +613,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](graphene-pk11/graphene-pk11.d.ts) [graphene-pk11](https://github.com/PeculiarVentures/graphene) by [Stepan Miroshin](https://github.com/microshine) * [:link:](graphviz/graphviz.d.ts) [Graphviz](https://github.com/glejeune/node-graphviz) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](gravatar/gravatar.d.ts) [gravatar](https://github.com/emerleite/node-gravatar) by [Denis Sokolov](https://github.com/denis-sokolov) +* [:link:](qrcode-generator/qrcode-generator.d.ts) [grcode-generator](https://github.com/kazuhikoarase/qrcode-generator) by [Stefan Huber](https://github.com/stefanhuber) * [:link:](greasemonkey/greasemonkey.d.ts) [Greasemonkey](http://www.greasespot.net) by [Kota Saito](https://github.com/kotas) * [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) * [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) * [:link:](gridstack/gridstack.d.ts) [Gridstack](http://troolee.github.io/gridstack.js) by [Pascal Senn](https://github.com/PascalSenn) * [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) -* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) +* [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) @@ -660,6 +684,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](gulp-watch/gulp-watch.d.ts) [gulp-watch](https://github.com/floatdrop/gulp-watch) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](hammerjs/hammerjs.d.ts) [Hammer.js](http://hammerjs.github.io) by [Philip Bulley](https://github.com/milkisevil), [Han Lin Yap](https://github.com/codler) * [:link:](handlebars/handlebars.d.ts) [Handlebars](http://handlebarsjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](handsontable/handsontable.d.ts) [Handsontable](https://handsontable.com) by [Handsoncode sp. z o.o.](http://handsoncode.net) * [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen) * [:link:](harmony-proxy/harmony-proxy.d.ts) [harmony-proxy](https://www.npmjs.com/package/harmony-proxy) by [Remo Jansen](https://github.com/remojansen) * [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT) @@ -681,6 +706,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](hopscotch/hopscotch.d.ts) [Hopscotch](http://linkedin.github.io/hopscotch) by [Tim Perry](https://github.com/pimterry) * [:link:](howlerjs/howler.d.ts) [howler.js](https://github.com/goldfire/howler.js) by [Pedro Casaubon](https://github.com/xperiments) * [:link:](touch-events/touch-events.d.ts) [HTML Touch Events](http://www.w3.org/TR/touch-events) by [Kevin Barabash](https://github.com/kevinb7) +* [:link:](html-entities/html-entities.d.ts) [html-entities](https://www.npmjs.com/package/html-entities) by [Xavier Stouder](https://github.com/xstoudi) * [:link:](html-to-text/html-to-text.d.ts) [html-to-text](https://github.com/werk85/node-html-to-text) by [Eryk Warren](https://github.com/erykwarren) * [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn) * [:link:](html-minifier/html-minifier.d.ts) [HTMLMinifier](https://github.com/kangax/html-minifier) by [Tanguy Krotoff](https://github.com/tkrotoff) @@ -693,8 +719,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac) * [:link:](hypertext-application-language/hypertext-application-language.d.ts) [Hypertext Application Language Draft 6](https://tools.ietf.org/html/draft-kelly-json-hal-06) by [Maks3w](https://github.com/maks3w) * [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Michael Ledin](https://github.com/mxl) * [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) -* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter) * [:link:](i18next-browser-languagedetector/i18next-browser-languagedetector.d.ts) [i18next-browser-languagedetector](http://i18next.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](i18next-express-middleware/i18next-express-middleware.d.ts) [i18next-express-middleware](http://i18next.com) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](i18next-node-fs-backend/i18next-node-fs-backend.d.ts) [i18next-node-fs-backend](https://github.com/i18next/i18next-node-fs-backend) by [Cyril Schumacher](https://github.com/cyrilschumacher) @@ -703,14 +729,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ibm-mobilefirst/ibm-mobilefirst.d.ts) [IBM MobileFirst Platform Foundation](http://www.ibm.com/software/products/en/mobilefirstfoundation) by [Guillermo Ignacio Enriquez Gutierrez](https://github.com/nacho4d) * [:link:](icepick/icepick.d.ts) [icepick](https://github.com/aearly/icepick) by [Nathan Brown](https://github.com/ngbrown) * [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) +* [:link:](iconv/iconv.d.ts) [iconv](https://github.com/bnoordhuis/node-iconv) by [delphinus](https://github.com/delphinus35) * [:link:](image-size/image-size.d.ts) [image-size](https://github.com/image-size/image-size) by [Elisée MAURER](https://github.com/elisee) * [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](imagesloaded/imagesloaded.d.ts) [imagesLoaded](https://github.com/desandro/imagesloaded) by [Chris Charabaruk](http://github.com/coldacid) * [: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:](immutability-helper/immutability-helper.d.ts) [immutability-helper](https://github.com/kolodny/immutability-helper) by [Sean Kelley](https://github.com/seansfkelley) * [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](incremental-dom/incremental-dom.d.ts) [Incremetal DOM](https://github.com/google/incremental-dom) by [Basarat Ali Syed](https://github.com/basarat), [Markus Lanthaler](https://github.com/lanthaler) * [:link:](inflected/inflected.d.ts) [inflected](https://github.com/martinandert/inflected) by [Daniel Schmidt](https://github.com/dsci) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) * [:link:](inherits/inherits.d.ts) [inherits](https://github.com/isaacs/inherits) by [Ilya Mochalov](https://github.com/chrootsu) @@ -727,6 +755,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify) * [:link:](ionic/ionic.d.ts) [Ionic](http://ionicframework.com) by [Spencer Williams](https://github.com/spencerwi) * [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](ioredis/ioredis.d.ts) [ioredis](https://github.com/luin/ioredis) by [York Yao](https://github.com/plantain-00) * [:link:](irc/irc.d.ts) [irc](https://github.com/martynsmith/node-irc) by [phillips1012](https://github.com/phillips1012) * [:link:](is-lower-case/is-lower-case.d.ts) [is-lower-case](https://github.com/blakeembrey/is-lower-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](is-my-json-valid/is-my-json-valid.d.ts) [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) by [kruncher](https://github.com/kruncher) @@ -877,6 +906,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](js-data-angular/js-data-angular.d.ts) [JSDataAngular](https://github.com/js-data/js-data-angular) by [Stefan Steinhart](https://github.com/reppners) * [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk) * [:link:](jsdom/jsdom.d.ts) [jsdom](https://github.com/tmpvar/jsdom) by [Asana](https://asana.com) +* [:link:](jsen/jsen.d.ts) [jsen (JSON Sentinel)](https://github.com/bugventure/jsen) by [Vladimir Đokić](https://github.com/vladeck) * [:link:](jsend/jsend.d.ts) [jsend](https://github.com/Prestaul/jsend) by [Federico Caselli](https://github.com/CaselIT) * [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](jsfl/jsfl.d.ts) [JSFL](https://adobe.com) by [soywiz](https://github.com/soywiz) @@ -888,6 +918,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jsnox/jsnox.d.ts) [JSnoX](https://github.com/af/jsnox) by [Steve Baker](https://github.com/stkb) * [:link:](json-patch/json-patch.d.ts) [json-patch](https://github.com/bruth/jsonpatch-js) by [vvakame](https://github.com/vvakame) * [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](json-socket/json-socket.d.ts) [json-socket](https://github.com/sebastianseilund/node-json-socket) by [Sven Reglitzki](https://github.com/svi3c) * [:link:](json-stable-stringify/json-stable-stringify.d.ts) [json-stable-stringify](https://github.com/substack/json-stable-stringify) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](json5/json5.d.ts) [JSON5](http://json5.org) by [Jason Swearingen](https://jasonswearingen.github.io) * [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone) @@ -904,6 +935,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jsts/jsts.d.ts) [jsts](https://github.com/bjornharrtell/jsts) by [Stephane Alie](https://github.com/StephaneAlie) * [:link:](jsuri/jsuri.d.ts) [jsUri](https://github.com/derek-watson/jsUri) by [Chris Charabaruk](http://github.com/coldacid), [Florian Wagner](http://github.com/flqw) * [:link:](jsurl/jsurl.d.ts) [jsurl](https://github.com/Mikhus/jsurl) by [Alexey Gorshkov](https://github.com/agorshkov23) +* [:link:](jsx-chai/jsx-chai.d.ts) [jsx-chai](https://github.com/bkonkle/jsx-chai) by [Philipp Holzer](https://github.com/nupplaphil) * [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) * [:link:](jug/jug.d.ts) [jug](https://github.com/kaiquewdev/Graph) by [yevt](https://github.com/yevt) * [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) @@ -947,17 +979,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ko.plus/ko.plus.d.ts) [ko.plus](https://github.com/stevegreatrex/ko.plus) by [Howard Richards](https://github.com/conficient) * [:link:](koa-compose/koa-compose.d.ts) [koa](https://github.com/koajs/compose) by [jKey Lu](https://github.com/jkeylu) * [:link:](koa/koa.d.ts) [Koa 2.x](http://koajs.com) by [DavidCai1993](https://github.com/DavidCai1993) +* [:link:](koa-bodyparser/koa-bodyparser.d.ts) [koa-bodyparser v3.x](https://github.com/koajs/bodyparser) by [Jerry Chin](https://github.com/hellopao) +* [:link:](koa-favicon/koa-favicon.d.ts) [koa-favicon v2.x](https://github.com/koajs/favicon) by [Jerry Chin](https://github.com/hellopao) +* [:link:](koa-json/koa-json.d.ts) [koa-json v2.x](https://github.com/koajs/json) by [Alex Friedman](https://github.com/brooklyndev) * [:link:](koa-router/koa-router.d.ts) [koa-router v7.x](https://github.com/alexmingoia/koa-router) by [Jerry Chin](https://github.com/hellopao) -* [:link:](kolite/knockout.dirtyFlag.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](kolite/knockout.command.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) -* [:link:](kolite/knockout.activity.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](koa-static/koa-static.d.ts) [koa-static v2.x](https://github.com/koajs/static) by [Jerry Chin](https://github.com/hellopao) * [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](kolite/knockout.activity.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](kolite/knockout.command.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](kolite/knockout.dirtyFlag.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) * [:link:](konami.js/konami.d.ts) [Konami-js](https://github.com/snaptortoise/konami-js) by [Matthieu Mourisson](https://github.com/mareek) * [:link:](kue/kue.d.ts) [kue 0.9.x](https://github.com/Automattic/kue) by [Nicholas Penree](http://github.com/drudge) * [:link:](kuromoji/kuromoji.d.ts) [kuromoji.js](https://github.com/takuyaa/kuromoji.js) by [MIZUSHIMA Junki](https://github.com/mzsm) * [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003), [Michael Lee](https://github.com/leemicw) * [:link:](lls/lls.d.ts) [LargeLocalStorage](https://github.com/tantaman/LargeLocalStorage) by [Borislav Zhivkov](https://github.com/borislavjivkov) * [:link:](later/later.d.ts) [LaterJS](http://bunkat.github.io/later) by [Jason D Dryhurst-Smith](http://jasonds.co.uk) +* [:link:](latinize/latinize.d.ts) [latinize](https://github.com/dundalek/latinize) by [Giedrius Grabauskas](https://github.com/GiedriusGrabauskas) * [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](lazypipe/lazypipe.d.ts) [lazypipe](https://github.com/OverZealous/lazypipe) by [Thomas Corbière](https://github.com/tomc974) * [:link:](leaflet-curve/leaflet-curve.d.ts) [leaflet-curve](https://github.com/onikiienko/Leaflet.curve) by [Onikiienko](https://github.com/onikiienko) @@ -992,7 +1029,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](loglevel/loglevel.d.ts) [loglevel](https://github.com/pimterry/loglevel) by [Stefan Profanter](https://github.com/Pro), [Florian Wagner](https://github.com/flqw) +* [:link:](loglevel/loglevel.d.ts) [loglevel](https://github.com/pimterry/loglevel) by [Stefan Profanter](https://github.com/Pro), [Florian Wagner](https://github.com/flqw), [Gabor Szmetanko](https://github.com/szmeti) * [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](lokijs/lokijs.d.ts) [lokijs](https://github.com/techfort/LokiJS) by [TeamworkGuy2](https://github.com/TeamworkGuy2) * [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157) @@ -1044,6 +1081,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node-mysql-wrapper/my-meteor.d.ts) [meteorjs for node-mysql-wrapper which helps in development](https://github.com/nodets/node-mysql-wrapper) by [Makis Maropoulos](https://github.com/kataras) * [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo) * [:link:](metismenu/metismenu.d.ts) [metisMenu](http://github.com/onokumus/metisMenu) by [onokums](https://github.com/onokumus) +* [:link:](microgears/microgears.d.ts) [microgears](http://github.com/marcusdb/microgears) by [Marcus David Bronstein](https://github.com/marcusdb) * [:link:](micromatch/micromatch.d.ts) [micromatch](https://github.com/jonschlinkert/micromatch) by [glen-84](https://github.com/glen-84) * [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee) * [:link:](xrm/xrm.d.ts) [Microsoft Dynamics xRM API](http://www.microsoft.com/en-us/download/details.aspx?id=44567) by [David Berry](https://github.com/6ix4our), [Matt Ngan](https://github.com/mattngan), [Markus Mauch](https://github.com/markusmauch) @@ -1072,8 +1110,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) * [:link:](mmmagic/mmmagic.d.ts) [mmmagic](https://github.com/mscdex/mmmagic) by [Andrei Sebastian Cîmpean](http://andreime.com) * [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter) -* [:link:](mobservable-react/mobservable-react.d.ts) [mobservable](https://github.com/mweststrate/mobservable-react) by [Michel Weststrate](https://github.com/mweststrate) * [:link:](mobservable/mobservable.d.ts) [mobservable](https://mweststrate.github.io/mobservable) by [Michel Weststrate](https://github.com/mweststrate) +* [:link:](mobservable-react/mobservable-react.d.ts) [mobservable](https://github.com/mweststrate/mobservable-react) by [Michel Weststrate](https://github.com/mweststrate) * [:link:](mocha/mocha-node.d.ts) [mocha](http://mochajs.org) by [Vadim Macagon](https://github.com/enlight), [vvakame](https://github.com/vvakame) * [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) @@ -1081,9 +1119,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) * [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [Leon Yu](https://github.com/leonyu) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) -* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) -* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) * [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware), [Gal Talmor](https://github.com/galtalmor) +* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware) +* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert) * [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native/tree/2.1) by [Federico Caselli](https://github.com/CaselIT) * [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) * [:link:](mongoose-auto-increment/mongoose-auto-increment.d.ts) [mongoose-auto-increment](https://github.com/codetunnel/mongoose-auto-increment) by [Aya Morisawa](https://github.com/AyaMorisawa) @@ -1101,7 +1139,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) * [:link:](msnodesql/msnodesql.d.ts) [msnodesql](https://github.com/WindowsAzure/node-sqlserver) by [Boris Yankov](https://github.com/borisyankov), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](msportalfx-test/msportalfx-test.d.ts) [msportalfx-test](https://msazure.visualstudio.com/DefaultCollection/AzureUX/_git/portalfx-msportalfx-test) by [Julio Casal](https://github.com/julioct) -* [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com), [Ben Farr](https://github.com/jaminfarr) +* [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com), [Ben Farr](https://github.com/jaminfarr), [Vitor Buzinaro](https://github.com/buzinas) * [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) * [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000), [vilicvane](https://vilic.github.io), [David Broder-Rodgers](https://github.com/DavidBR-SW) * [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) @@ -1109,6 +1147,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mz/mz.d.ts) [mz](https://github.com/normalize/mz) by [Thomas Hickman](https://github.com/ThomasHickman) * [:link:](nanoajax/nanoajax.d.ts) [nanoajax](https://github.com/yanatan16/nanoajax) by [Nathan Cahill](https://github.com/nathancahill) * [:link:](natural/natural.d.ts) [Natural](https://github.com/NaturalNode/natural) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) +* [:link:](natural-sort/natural-sort.d.ts) [NaturalSort](https://github.com/studio-b12/natural-sort) by [Antonio Morales](https://github.com/a-morales) * [:link:](navigation/navigation.d.ts) [Navigation](http://grahammendick.github.io/navigation) by [Graham Mendick](https://github.com/grahammendick) * [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo), [Jean-Martin Thibault](https://github.com/jmthibault) * [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) @@ -1117,6 +1156,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](netmask/netmask.d.ts) [Netmask](https://github.com/rs/node-netmask) by [Matt Frantz](https://github.com/mhfrantz) * [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame) * [:link:](ng-command/ng-command.d.ts) [ng-command](https://github.com/stephenlautier/ng-command) by [Stephen Lautier](https://github.com/stephenlautier) +* [:link:](ng-facebook/ng-facebook.d.ts) [ng-facebook](https://github.com/GoDisco/ngFacebook) by [Crevil](https://github.com/Crevil) * [:link:](ng-flow/ng-flow.d.ts) [ng-flow](https://github.com/flowjs/ng-flow) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) * [:link:](angular-idle/angular-idle.d.ts) [ng-idle](http://hackedbychinese.github.io/ng-idle) by [mthamil](https://github.com/mthamil) @@ -1147,7 +1187,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ng-stomp/ng-stomp.d.ts) [ngStomp](https://github.com/beevelop/ng-stomp) by [Lukasz Potapczuk](https://github.com/lpotapczuk) * [:link:](ngstorage/ngstorage.d.ts) [ngstorage](https://github.com/gsklee/ngStorage) by [Jakub Pistek](https://github.com/kubiq) * [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi) -* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) +* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider) * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) * [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](oauth2-server/oauth2-server.d.ts) [Node OAuth2 Server](https://github.com/thomseddon/node-oauth2-server) by [Robbie Van Gorkom](https://github.com/vangorra) @@ -1189,12 +1229,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node-sass-middleware/node-sass-middleware.d.ts) [node-sass-middleware](https://github.com/sass/node-sass-middleware) by [Pascal Garber](http://www.jumplink.eu) * [:link:](node-schedule/node-schedule.d.ts) [node-schedule](https://github.com/tejasmanohar/node-schedule) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](node-slack/node-slack.d.ts) [node-slack](https://github.com/xoxco/node-slack) by [Qubo](https://github.com/tkQubo) +* [:link:](node-snap7/node-snap7.d.ts) [node-snap7](https://github.com/mathiask88/node-snap7) by [Heilingbrunner](https://github.com/heilingbrunner) * [:link:](srp/srp.d.ts) [node-srp](https://github.com/mozilla/node-srp) by [Pat Smuk](https://github.com/Patman64) * [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless) * [:link:](node-uuid/node-uuid-global.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) -* [:link:](node-uuid/node-uuid-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-uuid/node-uuid-cjs.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid-base.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-validator/node-validator.d.ts) [node-validator](https://www.npmjs.com/package/node-validator) by [Ken Gorab](https://github.com/kengorab) * [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) * [: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), [Christopher Currens](https://github.com/ccurrens) @@ -1242,8 +1283,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](once/once.d.ts) [once](https://github.com/isaacs/once) by [Denis Sokolov](https://github.com/denis-sokolov) * [:link:](onoff/onoff.d.ts) [onoff](https://github.com/fivdi/onoff) by [Marcel Ernst](https://github.com/marcel-ernst) * [:link:](onsenui/onsenui.d.ts) [Onsen UI](http://onsen.io) by [Fran Dios](https://github.com/frankdiox) -* [:link:](deep-extend/deep-extend.d.ts) [open](https://github.com/unclechu/node-deep-extend) by [rhysd](https://github.com/rhysd) * [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](deep-extend/deep-extend.d.ts) [open](https://github.com/unclechu/node-deep-extend) by [rhysd](https://github.com/rhysd) * [:link:](OpenJsCad/openjscad.d.ts) [OpenJsCad.js](https://github.com/joostn/OpenJsCad) by [Dan Marshall](https://github.com/danmarshall) * [:link:](openlayers/openlayers.d.ts) [OpenLayers](http://openlayers.org) by [Wouter Goedhart](https://github.com/woutergd) * [:link:](openpgp/openpgp.d.ts) [openpgpjs](http://openpgpjs.org) by [Guillaume Lacasa](https://blog.lacasa.fr) @@ -1271,12 +1312,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](pascal-case/pascal-case.d.ts) [pascal-case](https://github.com/blakeembrey/pascal-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) -* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) * [:link:](passport-http-bearer/passport-http-bearer.d.ts) [passport-http-bearer](https://github.com/jaredhanson/passport-http-bearer) by [Isman Usoh](https://github.com/isman-usoh) +* [:link:](passport-jwt/passport-jwt.d.ts) [passport-jwt](https://github.com/themikenicholson/passport-jwt) by [TANAKA Koichi](https://github.com/mugeso) * [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](password-hash/password-hash.d.ts) [password-hash 1.2.x](https://github.com/davidwood/node-password-hash) by [TANAKA Koichi](https://github.com/mugeso) * [:link:](path-case/path-case.d.ts) [path-case](https://github.com/blakeembrey/path-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](path-exists/path-exists.d.ts) [path-exists](https://github.com/sindresorhus/path-exists) by [Shogo Iwano](https://github.com/shiwano) * [:link:](path-parse/path-parse.d.ts) [path-parse](https://github.com/jbgutierrez/path-parse) by [Dan Chao](http://dchao.co) @@ -1291,7 +1334,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](pegjs/pegjs.d.ts) [PEG.js](http://pegjs.org) by [vvakame](https://github.com/vvakame), [Tobias Kahlert](https://github.com/SrTobi) * [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto) * [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com) -* [:link:](pg-promise/pg-promise.d.ts) [pg-promise](https://github.com/vitaly-t/pg-promise) by [Jörg Dotzki](https://github.com/ISO50) +* [:link:](pg-promise/pg-promise.d.ts) [pg-promise](https://github.com/vitaly-t/pg-promise) by [vvakame](https://github.com/vvakame) * [:link:](pgwmodal/pgwmodal.d.ts) [PgwModal](http://pgwjs.com/pgwmodal) by [Pine Mizune](https://github.com/pine613) * [:link:](phantomcss/phantomcss.d.ts) [PhantomCSS](https://github.com/Huddle/PhantomCSS) by [Amaury Bauzac](https://github.com/abauzac) * [:link:](phantom/phantom.d.ts) [PhantomJS bridge for NodeJS](https://github.com/sgentle/phantomjs-node) by [horiuchi](https://github.com/horiuchi), [Random](https://github.com/llRandom) @@ -1336,9 +1379,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](prelude-ls/prelude-ls.d.ts) [prelude.ls](http://www.preludels.com) by [Aya Morisawa](https://github.com/AyaMorisawa) * [:link:](prettyjson/prettyjson.d.ts) [prettyjson](https://github.com/rafeca/prettyjson) by [Wael BEN ZID EL GUEBSI](https://github.com/benzid-wael) * [:link:](meteor-prime8consulting-oauth2/meteor-prime8consulting-oauth2.d.ts) [prime8consulting:meteor-oauth2](https://github.com/prime-8-consulting/meteor-oauth2) by [Robbie Van Gorkom](https://github.com/vangorra) +* [:link:](prismjs/prism.d.ts) [prism](http://prismjs.com) by [Erik Lieben](https://github.com/eriklieben) * [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli) * [:link:](project-oxford/project-oxford.d.ts) [project-oxford](https://github.com/felixrieseberg/project-oxford) by [Scott Southwood](https://github.com/scsouthw) * [:link:](promise/promise.d.ts) [promise](https://www.promisejs.org) by [Manuel Rueda](https://github.com/ManRueda) +* [:link:](promise-pg/promise-pg.d.ts) [promise-pg](https://bitbucket.org/lplabs/promise-pg) by [Chris Charabaruk](http://github.com/coldacid) * [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) * [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](promisify-supertest/promisify-supertest.d.ts) [promisify-supertest](https://www.npmjs.com/package/promisify-supertest) by [Leo Liang](https://github.com/aleung) @@ -1364,6 +1409,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](qwest/qwest.d.ts) [qwest](https://github.com/pyrsmk/qwest) by [Lindsay Evans](https://github.com/lindsayevans) * [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) * [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) +* [:link:](radium/radium.d.ts) [radium](https://github.com/formidablelabs/radium) by [Alex Gorbatchev](https://github.com/alexgorbatchev), [Philipp Holzer](https://github.com/nupplaphil) * [:link:](random-js/random-js.d.ts) [random-js](https://github.com/ckknight/random-js) by [Gustavo Di Pietro](https://github.com/pistacchio) * [:link:](random-string/random-string.d.ts) [random-string](https://github.com/valiton/node-random-string) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](rangy/rangy.d.ts) [Rangy](https://github.com/timdown/rangy) by [Rudolph Gottesheim](http://www.midnight-design.at) @@ -1390,6 +1436,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rc-select/rc-select.d.ts) [React Select](https://github.com/react-component/select) by [Denis Tirilis](https://github.com/DenisTirilis) * [:link:](react-bootstrap/react-bootstrap.d.ts) [react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) by [Walker Burgin](https://github.com/walkerburgin), [Vincent Siao](https://github.com/vsiao) * [:link:](react-bootstrap-table/react-bootstrap-table.d.ts) [react-bootstrap-table](https://github.com/AllenFang/react-bootstrap-table) by [Frank Laub](https://github.com/flaub) +* [:link:](react-cropper/react-cropper.d.ts) [react-cropper](https://github.com/roadmanfong/react-cropper) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](react-datagrid/react-datagrid.d.ts) [react-datagrid](https://github.com/zippyui/react-datagrid.git) by [Stephen Jelfs](https://github.com/stephenjelfs) * [:link:](react-day-picker/react-day-picker.d.ts) [react-day-picker](https://github.com/gpbl/react-day-picker) by [Giampaolo Bellavite](https://github.com/gpbl), [Jason Killian](https://github.com/jkillian) * [:link:](react-dropzone/react-dropzone.d.ts) [react-dropzone](https://github.com/paramaggarwal/react-dropzone) by [Mathieu Larouche Dube](https://github.com/matdube) @@ -1400,9 +1447,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react-input-calendar/react-input-calendar.d.ts) [react-input-calendar](https://github.com/Rudeg/react-input-calendar) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](react-intl/react-intl.d.ts) [react-intl](http://formatjs.io/react) by [Bruno Grieder](https://github.com/bgrieder), [Christian Droulers](https://github.com/cdroulers) * [:link:](react-mixin/react-mixin.d.ts) [react-mixin](https://github.com/brigand/react-mixin) by [Qubo](https://github.com/tkqubo) +* [:link:](react-motion/react-motion.d.ts) [react-motion](https://github.com/chenglou/react-motion) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](react-native/react-native.d.ts) [react-native](https://github.com/facebook/react-native) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](react-props-decorators/react-props-decorators.d.ts) [react-props-decorators](https://github.com/popkirby/react-props-decorators) by [Qubo](https://github.com/tkqubo) -* [:link:](react-redux/react-redux.d.ts) [react-redux](https://github.com/rackt/react-redux) by [Qubo](https://github.com/tkqubo) +* [:link:](react-redux/react-redux.d.ts) [react-redux](https://github.com/rackt/react-redux) by [Qubo](https://github.com/tkqubo), [Sean Kelley](https://github.com/seansfkelley) * [:link:](react-router/react-router.d.ts) [react-router](https://github.com/rackt/react-router) by [Sergey Buturlakin](https://github.com/sergey-buturlakin), [Yuichi Murata](https://github.com/mrk21), [Václav Ostrožlík](https://github.com/vasek17), [Nathan Brown](https://github.com/ngbrown) * [:link:](react-router-bootstrap/react-router-bootstrap.d.ts) [react-router-bootstrap](https://github.com/react-bootstrap/react-router-bootstrap) by [Vincent Lesierse](https://github.com/vlesierse) * [:link:](react-router-redux/react-router-redux.d.ts) [react-router-redux](https://github.com/rackt/react-router-redux) by [Isman Usoh](http://github.com/isman-usoh), [Noah Shipley](https://github.com/noah79), [Dimitri Rosenberg](https://github.com/rosendi) @@ -1411,15 +1459,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react-spinkit/react-spinkit.d.ts) [react-spinkit](https://github.com/KyleAMathews/react-spinkit) by [Qubo](https://github.com/tkqubo) * [:link:](react-swf/react-swf.d.ts) [react-swf](https://github.com/syranide/react-swf) by [Stepan Mikhaylyuk](https://github.com/stepancar) * [:link:](react-swipeable-views/react-swipeable-views.d.ts) [react-swipeable-views](https://github.com/oliviertassinari/react-swipeable-views) by [Michael Ledin](https://github.com/mxl) +* [:link:](react-tabs/react-tabs.d.ts) [react-tabs](https://github.com/reactjs/react-tabs) by [Yuu Igarashi](https://github.com/yu-i9) +* [:link:](react-tagcloud/react-tagcloud.d.ts) [react-tagcloud](https://github.com/madox2/react-tagcloud) by [wassname](https://github.com/wassname) * [:link:](react-tap-event-plugin/react-tap-event-plugin.d.ts) [react-tap-event-plugin](https://github.com/zilverline/react-tap-event-plugin) by [Michael Ledin](https://github.com/mxl) +* [:link:](react-widgets/react-widgets.d.ts) [react-widgets](https://github.com/jquense/react-widgets) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](read/read.d.ts) [read](https://github.com/isaacs/read) by [Tim JK](https://github.com/timjk) * [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](rebass/rebass.d.ts) [Rebass](https://github.com/jxnblk/rebass) by [rhysd](https://rhysd.github.io) * [:link:](recursive-readdir/recursive-readdir.d.ts) [recursive-readdir](https://github.com/jergason/recursive-readdir) by [Elisée Maurer](https://github.com/elisee) * [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal), [TANAKA Koichi](https://github.com/MugeSo) * [:link:](redlock/redlock.d.ts) [Redlock](https://github.com/mike-marcacci/node-redlock) by [Ilya Mochalov](https://github.com/chrootsu) * [:link:](redux/redux.d.ts) [Redux](https://github.com/rackt/redux) by [William Buchwalter](https://github.com/wbuchwalter), [Vincent Prouillet](https://github.com/Keats) * [:link:](redux-action-utils/redux-action-utils.d.ts) [redux-action-utils](https://github.com/insin/redux-action-utils) by [Qubo](https://github.com/tkqubo) * [:link:](redux-actions/redux-actions.d.ts) [redux-actions](https://github.com/acdlite/redux-actions) by [Jack Hsu](https://github.com/jaysoo) +* [:link:](redux-debounced/redux-debounced.d.ts) [redux-debounced](https://github.com/ryanseddon/redux-debounced) by [Sean Kelley](https://github.com/seansfkelley) * [:link:](redux-devtools/redux-devtools.d.ts) [redux-devtools](https://github.com/gaearon/redux-devtools) by [Petryshyn Sergii](https://github.com/mc-petry) * [:link:](redux-devtools-dock-monitor/redux-devtools-dock-monitor.d.ts) [redux-devtools-dock-monitor](https://github.com/gaearon/redux-devtools-dock-monitor) by [Petryshyn Sergii](https://github.com/mc-petry) * [:link:](redux-devtools-log-monitor/redux-devtools-log-monitor.d.ts) [redux-devtools-log-monitor](https://github.com/gaearon/redux-devtools-log-monitor) by [Petryshyn Sergii](https://github.com/mc-petry) @@ -1427,6 +1480,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react-scroll/react-scroll.d.ts) [redux-immutable](https://github.com/fisshy/react-scroll) by [Pedro Pereira](https://github.com/oizie) * [:link:](redux-immutable/redux-immutable.d.ts) [redux-immutable](https://github.com/gajus/redux-immutable) by [Pedro Pereira](https://github.com/oizie) * [:link:](redux-logger/redux-logger.d.ts) [redux-logger](https://github.com/fcomb/redux-logger) by [Alexander Rusakov](https://github.com/arusakov) +* [:link:](redux-promise/redux-promise.d.ts) [redux-promise](https://github.com/acdlite/redux-promise) by [Rogelio Morrell Caballero](https://github.com/molekilla) * [:link:](redux-router/redux-router.d.ts) [redux-router](https://github.com/rackt/redux-router) by [Stepan Mikhaylyuk](http://github.com/stepancar) * [:link:](redux-saga/redux-saga.d.ts) [redux-saga](https://github.com/yelouafi/redux-saga) by [Daniel Lytkin](https://github.com/aikoven), [Dimitri Rosenberg](https://github.com/rosendi) * [:link:](redux-thunk/redux-thunk.d.ts) [redux-thunk](https://github.com/gaearon/redux-thunk) by [Qubo](https://github.com/tkqubo) @@ -1443,6 +1497,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](reselect/reselect.d.ts) [reselect](https://github.com/rackt/reselect) by [Ian Ker-Seymer](https://github.com/ianks) * [:link:](resemblejs/resemblejs.d.ts) [Resemble.js](http://huddle.github.io/Resemble.js) by [Tim Perry](https://github.com/pimterry) +* [:link:](resolve-from/resolve-from.d.ts) [resolve-from](https://github.com/sindresorhus/resolve-from) by [unional](https://github.com/unional) * [:link:](response-time/response-time.d.ts) [response-time](https://github.com/expressjs/response-time) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](rest-io/rest-io.d.ts) [rest-io](https://github.com/EnoF/rest-io) by [Andy Tang](https://github.com/EnoF), [Stefan Schacherl](https://github.com/TheBay0r) * [:link:](rest/rest.d.ts) [rest.js](https://github.com/cujojs/rest) by [Wim Looman](https://github.com/Nemo157) @@ -1469,6 +1524,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) * [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx-dom/rx-dom.d.ts) [RxJS](https://github.com/Reactive-Extensions/RxJS-DOM) by [oliver Weichhold](https://github.com/oliverw) * [:link:](rx/rx.aggregates.d.ts) [RxJS-Aggregates](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](rx/rx.all.d.ts) [RxJS-All](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) * [:link:](rx/rx.async.d.ts) [RxJS-Async](http://rx.codeplex.com) by [zoetrope](https://github.com/zoetrope), [Igor Oleinikov](https://github.com/Igorbek) @@ -1511,8 +1567,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sentence-case/sentence-case.d.ts) [sentence-case](https://github.com/blakeembrey/sentence-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](sequelize/sequelize.d.ts) [Sequelize](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal), [Ivan Drinchev](https://github.com/drinchev) * [:link:](sequelize-fixtures/sequelize-fixtures.d.ts) [Sequelize-Fixtures](https://github.com/domasx2/sequelize-fixtures) by [Christian Schwarz](https://github.com/cschwarz) -* [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) * [: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-index/serve-index.d.ts) [serve-index](https://github.com/expressjs/serve-index) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](ss-utils/ss-utils.d.ts) [ServiceStack Utils](https://servicestack.net) by [Demis Bellot](https://github.com/mythz) @@ -1546,13 +1602,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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:](slideout/slideout.d.ts) [Slideout](https://github.com/mango/slideout) by [Markus Peloso](https://github.com/ToastHawaii) * [: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) * [:link:](smtpapi/smtpapi.d.ts) [smtpapi-nodejs](https://github.com/sendgrid/smtpapi-nodejs) by [Antonio Morales](https://github.com/a-morales) * [:link:](snake-case/snake-case.d.ts) [snake-case](https://github.com/blakeembrey/snake-case) by [Sam Saint-Pettersen](https://github.com/stpettersens) * [:link:](snapsvg/snapsvg.d.ts) [Snap-SVG](https://github.com/adobe-webplatform/Snap.svg) by [Lars Klein](https://github.com/lhk), [Mattanja Kern](https://github.com/mattanja) * [:link:](soap/soap.d.ts) [soap](https://www.npmjs.com/package/soap) by [Nicole Wang](https://github.com/nicoleWjie) +* [:link:](cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing.d.ts) [SocialSharing-PhoneGap-Plugin](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) by [Markus Wagner](https://github.com/Ritzlgrmft) * [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages), [Florent Poujol](https://github.com/florentpoujol) * [:link:](socket.io-client/socket.io-client.d.ts) [socket.io-client](http://socket.io) by [PROGRE](https://github.com/progre), [Damian Connolly](https://github.com/divillysausages), [Florent Poujol](https://github.com/florentpoujol) +* [:link:](socket.io-redis/socket.io-redis.d.ts) [socket.io-redis](https://github.com/socketio/socket.io-redis) by [Philipp Holzer](https://github.com/nupplaphil) * [:link:](socket.io.users/socket.io.users.d.ts) [socket.io.users](https://github.com/nodets/socket.io.users) by [Makis Maropoulos](https://github.com/kataras) * [:link:](socketty/socketty.d.ts) [Socketty](https://www.npmjs.com/package/socketty) by [Nax](https://github.com/Nax) * [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) @@ -1586,6 +1645,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](steam/steam.d.ts) [steam](https://github.com/seishun/node-steam) by [Andrey Kurdyumov](https://github.com/kant2002) * [:link:](slick-carousel/slick-carousel.d.ts) [stick](http://kenwheeler.github.io/slick) by [John Gouigouix](https://github.com/orchestra-ts/DefinitelyTyped) * [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](stream-meter/stream-meter.d.ts) [stream-meter](https://github.com/brycebaril/node-stream-meter) by [TANAKA Koichi](https://github.com/mugeso) * [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) @@ -1594,7 +1654,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](strip-json-comments/strip-json-comments.d.ts) [strip-json-comments](https://github.com/sindresorhus/strip-json-comments) by [Dylan R. E. Moonfire](https://github.com/dmoonfire) * [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Andy Hawkins](https://github.com/a904guy/,http://a904guy.com), [Eric J. Smith](https://github.com/ejsmith), [Amrit Kahlon](https://github.com/amritk) * [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench) -* [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto) +* [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto), [Peter Harris](https://github.com/codeanimal) * [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch) * [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin) @@ -1637,6 +1697,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) * [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) * [:link:](facebook-js-sdk/facebook-js-sdk.d.ts) [the Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Amrit Kahlon](https://github.com/amritk) +* [:link:](facebook-pixel/facebook-pixel.d.ts) [the Facebook Pixel Tag API](https://developers.facebook.com/docs/ads-for-websites/tag-api) by [Noctis Hsu](https://github.com/noctishsu) * [:link:](spotify-api/spotify-api.d.ts) [The Spotify Web API](https://developer.spotify.com/web-api) by [Niels Kristian Hansen Skovmand](https://github.com/skovmand) * [:link:](threejs/three-FirstPersonControls.d.ts) [three.js](http://mrdoob.github.com/three.js) by [Poul Kjeldager Sørensen](https://github.com/s093294) * [:link:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) @@ -1655,7 +1716,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](threejs/three-transformcontrols.d.ts) [three.js (TransformControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TransformControls.js) by [Stefan Profanter](https://github.com/Pro) * [:link:](threejs/three-vrcontrols.d.ts) [three.js (VRControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/VRControls.js) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](threejs/three-vreffect.d.ts) [three.js (VREffect.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/effects/VREffect.js) by [Toshiya Nakakura](https://github.com/nakakura) -* [:link:](threejs/three.d.ts) [three.js r73](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) +* [:link:](threejs/three.d.ts) [three.js r75](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk), [Florent Poujol](https://github.com/florentpoujol), [SereznoKot](https://github.com/SereznoKot) * [:link:](thrift/thrift.d.ts) [thrift](https://www.npmjs.com/package/thrift) by [Zachary Collins](https://github.com/corps) * [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao), [Georgios Valotasios](https://github.com/valotas) @@ -1684,14 +1745,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](twitter/twitter.d.ts) [Twitter for Websites](https://dev.twitter.com/web) by [Chitoku](https://github.com/chitoku-k) * [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](twitter-text/twitter-text.d.ts) [twitter-text](https://github.com/twitter/twitter-text) by [rhysd](https://rhysd.github.io) * [:link:](twix/twix.d.ts) [twix.js](https://github.com/icambron/twix.js) by [j3ko](https://github.com/j3ko) * [:link:](type-check/type-check.d.ts) [type-check](https://github.com/gkz/type-check) by [Hans Windhoff](https://github.com/hansrwindhoff) * [: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:](type-name/type-name.d.ts) [type-name](https://github.com/twada/type-name) by [OKUNOKENTARO](https://github.com/armorik83) * [: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:](webfontloader/webfontloader.d.ts) [typekit-webfontloader](https://github.com/typekit/webfontloader) by [doskallemaskin](https://github.com/doskallemaskin) -* [:link:](typescript/typescript.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org) * [:link:](typescript-services/typescriptServices.d.ts) [TypeScript API](http://www.typescriptlang.org) by [Microsoft TypeScript](http://typescriptlang.org) +* [: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:](meteor-persistent-session/meteor-persistent-session.d.ts) [u2622:persistent-session](https://github.com/okgrow/meteor-persistent-session) by [Robbie Van Gorkom](https://github.com/vangorra) * [:link:](ua-parser-js/ua-parser-js.d.ts) [ua-parser-js](https://github.com/faisalman/ua-parser-js) by [Viktor Miroshnikov](https://github.com/superduper), [Lucas Woo](https://github.com/legendecas) @@ -1701,8 +1763,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ui-router-extras/ui-router-extras.d.ts) [UI-Router Extras (ct.ui.router.extras module)](https://github.com/christopherthielen/ui-router-extras) by [Michael Putters](https://github.com/mputters), [Marcel van de Kamp](https://github.com/marcel-k) * [:link:](ui-select/ui-select.d.ts) [ui-select](https://github.com/angular-ui/ui-select) by [Niko Kovačič](https://github.com/nkovacic) * [:link:](uikit/uikit.d.ts) [uikit](http://getuikit.org) by [Giovanni Silva](https://github.com/giovannicandido) -* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco-resources.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) +* [:link:](umbraco/umbraco-services.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umbraco/umbraco.d.ts) [Umbraco](https://github.com/umbraco) by [DeCareSystemsIreland](https://github.com/DeCareSystemsIreland) * [:link:](umzug/umzug.d.ts) [Umzug](https://github.com/sequelize/umzug) by [Ivan Drinchev](https://github.com/drinchev) * [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin), [Christopher Currens](https://github.com/ccurrens) @@ -1727,6 +1789,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](usage/usage.d.ts) [usage](https://github.com/arunoda/node-usage) by [Pascal Vomhoff](https://github.com/pvomhoff) * [:link:](username/username.d.ts) [username](https://www.npmjs.com/package/username) by [Klaus Reimer](https://github.com/kayahr) * [:link:](utils-merge/utils-merge.d.ts) [utils-merge](https://github.com/jaredhanson/utils-merge) by [Ilya Mochalov](https://github.com/chrootsu) +* [:link:](uuid-1345/uuid-1345.d.ts) [uuid-1345](https://github.com/scravy/uuid-1345) by [TANAKA Koichi](https://github.com/mugeso) * [:link:](uuid/UUID.d.ts) [UUID.js](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) * [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) * [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt), [Ilya Mochalov](https://github.com/chrootsu) @@ -1753,6 +1816,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vue/vue.d.ts) [vuejs](https://github.com/vuejs/vue) by [odangosan](https://github.com/odangosan), [kaorun343](https://github.com/kaorun343) * [:link:](w2ui/w2ui.d.ts) [w2ui](http://w2ui.com) by [Valentin Robert](https://github.com/Ptival) * [:link:](wake_on_lan/wake_on_lan.d.ts) [wake_on_lan](https://github.com/agnat/node_wake_on_lan) by [Tobias Kahlert](https://github.com/SrTobi) +* [:link:](wampy/wampy.d.ts) [wampy.js](https://github.com/KSDaemon/wampy.js) by [Konstantin Burkalev](https://github.com/KSDaemon) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) * [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) @@ -1775,6 +1839,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [: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-1251/windows-1251.d.ts) [windows-1251](https://github.com/mathiasbynens/windows-1251) by [RomanGolovanov](https://github.com/RomanGolovanov) * [: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:](winreg/winreg.d.ts) [Winreg](https://github.com/fresc81/node-winreg) by [RX14](https://github.com/RX14) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 02d2c540a0..a54ed5d515 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -803,6 +803,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val textClickEnabled: boolean; /** In case legend position is set to "absolute", you can set distance from top of the chart, in pixels. */ top: number; + /** Legend markers can mirror graph’s settings, displaying a line and a real bullet as in the graph itself. + Set this property to true if you want to enable this feature. Note, if you set graph colors in dataProvider, they will not be reflected in the marker. + @default false*/ + useGraphSettings: boolean; /** Specifies if legend labels should be use same color as corresponding markers. */ useMarkerColorForLabels: boolean; /** Alignment of the value text. Possible values are "left" and "right". right */ @@ -1239,6 +1243,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Specifies if a grid line is placed on the center of a cell or on the beginning of a cell. Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true. middle */ gridPosition: string; + /** Specifies if minor grid should be displayed. + NOTE: If equalSpacing is set to true, this setting will be ignored. + @default false*/ + minorGridEnabled: boolean; + /** Specifies the shortest period of your data. This should be set only if parseDates is set to "true". Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. DD */ minPeriod: string; @@ -1248,6 +1257,14 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Specifies whether the graph should start on axis or not. In case you display columns, it is recommended to set this to false. If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true. */ startOnAxis: boolean; + /** Works only when parseDates is set to true and equalSpacing is false. If you set it to true, at the position where bigger period changes, + category axis will display date strings of bot small and big period, in two rows. + @default false*/ + twoLineMode: boolean; + + /** Use line color for bullet + @default false*/ + useLineColorForBulletBorder: boolean; /** Number returns coordinate of a category. Works only if parseDates is false. If parseDates is true, use dateToCoordinate method. category - String */ categoryToCoordinate(category: string); @@ -1486,6 +1503,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val @default true */ enabled: boolean; + /** If set to true, instead of a cursor line user will see a fill which width will always be equal to the width of one data item. + Recommend setting cursorAlpha to 0.1 or some other small number if using this feature. + @default false*/ + fullWidth: boolean; /** If this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming. */ oneBalloonOnly: boolean; /** If this is set to true, the user will be able to pan the chart (Serial only) instead of zooming. */ diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 6ba65473ed..12fe28a9b8 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -250,4 +250,25 @@ declare namespace angular.material { interface IMenuService { hide(response?: any, options?: any): angular.IPromise; } + + interface IColorPalette { + red: IPalette; + pink: IPalette; + 'deep-purple': IPalette; + indigo: IPalette; + blue: IPalette; + 'light-blue': IPalette; + cyan: IPalette; + teal: IPalette; + green: IPalette; + 'light-green': IPalette; + lime: IPalette; + yellow: IPalette; + amber: IPalette; + orange: IPalette; + 'deep-orange': IPalette; + brown: IPalette; + grey: IPalette; + 'blue-grey': IPalette; + } } diff --git a/angular-permission/angular-permission-tests.ts b/angular-permission/angular-permission-tests.ts index d14f7ac7e3..206850ad70 100644 --- a/angular-permission/angular-permission-tests.ts +++ b/angular-permission/angular-permission-tests.ts @@ -1,6 +1,6 @@ /// -import * as permission from 'angular-permission'; +import permission = angular.permission; angular .module('fooModule', ['permission', 'user']) diff --git a/angular-permission/angular-permission.d.ts b/angular-permission/angular-permission.d.ts index 0a1a28188f..afe32ce875 100644 --- a/angular-permission/angular-permission.d.ts +++ b/angular-permission/angular-permission.d.ts @@ -6,7 +6,8 @@ /// /// -declare module 'angular-permission' { +declare namespace angular.permission { + export interface PermissionStore { /** * Allows to define permission on application configuration diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index ba42f16cf4..9c5db1754a 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -141,6 +141,8 @@ class UrlLocatorTestService implements IUrlLocatorTestService { private $state: ng.ui.IStateService ) { $rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event)); + $rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) => + this.onStateNotFound(event, unfoundState, fromState, fromParams)); } public currentUser: any; @@ -162,6 +164,15 @@ class UrlLocatorTestService implements IUrlLocatorTestService { }); } } + + private onStateNotFound(event: ng.IAngularEvent, + unfoundState: ng.ui.IUnfoundState, + fromState: ng.ui.IState, + fromParams: {}) { + var unfoundTo: string = unfoundState.to; + var unfoundToParams: {} = unfoundState.toParams; + var unfoundOptions: ng.ui.IStateOptions = unfoundState.options + } private stateServiceTest() { this.$state.go("myState"); diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 17d1570983..0512528097 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -100,6 +100,12 @@ declare namespace angular.ui { cache?: boolean; } + interface IUnfoundState { + to: string, + toParams: {}, + options: IStateOptions + } + interface IStateProvider extends angular.IServiceProvider { state(name:string, config:IState): IStateProvider; state(config:IState): IStateProvider; diff --git a/angularjs/angular-mocks-tests.ts b/angularjs/angular-mocks-tests.ts index 86bbe6c945..294bcf8982 100644 --- a/angularjs/angular-mocks-tests.ts +++ b/angularjs/angular-mocks-tests.ts @@ -87,6 +87,15 @@ logCall = logService.warn; logs = logCall.logs; +/////////////////////////////////////// +// ControllerService mock +/////////////////////////////////////// +var $controller: ng.IControllerService; +$controller(class TestController {}, {}, {myBinding: 'works!'}); +$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'}); +$controller('TestController', {}, {myBinding: 'works!'}); + + /////////////////////////////////////// // IComponentControllerService /////////////////////////////////////// diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 429c7b5269..c97471e5bf 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -97,6 +97,18 @@ declare namespace angular { logs: string[]; } + /////////////////////////////////////////////////////////////////////////// + // ControllerService mock + // see https://docs.angularjs.org/api/ngMock/service/$controller + // This interface extends http://docs.angularjs.org/api/ng.$controller + /////////////////////////////////////////////////////////////////////////// + interface IControllerService { + // Although the documentation doesn't state this, locals are optional + (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T; + (controllerConstructor: Function, locals?: any, bindings?: any): T; + (controllerName: string, locals?: any, bindings?: any): T; + } + /////////////////////////////////////////////////////////////////////////// // ComponentControllerService // see https://docs.angularjs.org/api/ngMock/service/$componentController diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 5a9963b14c..89f6d25a26 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { var promise : angular.IPromise; var arrayPromise : angular.IPromise; -var json: { - [index: string]: any; -}; +var json: IMyResource; promise = resource.$delete(); promise = resource.$delete({ key: 'value' }); diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index caae65ccb2..0fb9351342 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -153,9 +153,7 @@ declare namespace angular.resource { /** the promise of the original server interaction that created this instance. **/ $promise : angular.IPromise; $resolved : boolean; - toJSON: () => { - [index: string]: any; - } + toJSON(): T; } /** diff --git a/angularjs/angularjs.d.ts b/angularjs/angularjs.d.ts index e86fd37052..3d2b248637 100644 --- a/angularjs/angularjs.d.ts +++ b/angularjs/angularjs.d.ts @@ -204,7 +204,7 @@ declare namespace angular { * @param name The name of the constant. * @param value The constant value. */ - constant(name: string, value: any): IModule; + constant(name: string, value: T): IModule; constant(object: Object): IModule; /** * The $controller service is used by Angular to create new controllers. @@ -294,7 +294,7 @@ declare namespace angular { * @param name The name of the instance. * @param value The value. */ - value(name: string, value: any): IModule; + value(name: string, value: T): IModule; value(object: Object): IModule; /** diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index be849cee04..b42b6208ad 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -311,7 +311,7 @@ declare namespace Backbone { start(options?: HistoryOptions): boolean; getHash(window?: Window): string; - getFragment(fragment?: string, forcePushState?: boolean): string; + getFragment(fragment?: string): string; stop(): void; route(route: string, callback: Function): number; checkUrl(e?: any): void; @@ -328,6 +328,7 @@ declare namespace Backbone { // TODO: quickfix, this can't be fixed easy. The collection does not need to have the same model as the parent view. collection?: Backbone.Collection; //was: Collection; el?: any; + events?: EventsHash; id?: string; className?: string; tagName?: string; diff --git a/bunyan/bunyan.d.ts b/bunyan/bunyan.d.ts index 4ea2668a2b..dd569301f5 100644 --- a/bunyan/bunyan.d.ts +++ b/bunyan/bunyan.d.ts @@ -20,6 +20,9 @@ declare module "bunyan" { level(value: number | string):void; levels(name: number | string, value: number | string):void; + fields:any; + src:boolean; + trace(error:Error, format?:any, ...params:any[]):void; trace(buffer:Buffer, format?:any, ...params:any[]):void; trace(obj:Object, format?:any, ...params:any[]):void; diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index ca2b4206d8..6c679dc1d8 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -557,3 +557,7 @@ declare namespace Chartist { } declare var Chartist: Chartist.ChartistStatic; + +declare module 'chartist' { + export = Chartist; +} diff --git a/cookiejs/cookiejs.d.ts b/cookiejs/cookiejs.d.ts index 1bc4d2b5ee..77b8973aed 100644 --- a/cookiejs/cookiejs.d.ts +++ b/cookiejs/cookiejs.d.ts @@ -2,20 +2,46 @@ // Project: https://github.com/js-coder/cookie.js // Definitions by: Boltmade // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +/** + * Shortcut for cookie.get() + */ declare function cookie(key : string, fallback?: string) : string; declare function cookie(keys : string[], fallback?: string) : string; declare namespace cookie { + /** + * Create a cookie. The value will automatically be escaped. + */ export function set(key : string, value : string, options? : any) : void; + /** + * Set several cookies at once + */ export function set(obj : any, options? : any) : void; + /** + * Remove cookies + */ export function remove(key : string) : void; export function remove(keys : string[]) : void; export function remove(...args : string[]) : void; + /** + * Remove all cookies + */ export function empty() : void; + /** + * Retrieve the value of the cookie + */ export function get(key : string, fallback?: string) : string; - export function get(keys : string[], fallback?: string) : string; + /** + * Retrieve values of several cookies + */ + export function get(keys : string[], fallback?: string) : any; + /** + * Get all currently saved cookies + */ export function all() : any; + /** + * Test if cookies are enabled + */ export function enabled() : boolean; } diff --git a/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts b/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts new file mode 100644 index 0000000000..9620d77755 --- /dev/null +++ b/cordova-plugin-background-mode/cordova-plugin-background-mode-tests.ts @@ -0,0 +1,14 @@ +/// +/// + +cordova.plugins.backgroundMode.setDefaults({ silent: true }); + +cordova.plugins.backgroundMode.enable(); +cordova.plugins.backgroundMode.isEnabled(); +cordova.plugins.backgroundMode.isActivated(); + +cordova.plugins.backgroundMode.configure({ text: 'Insane Title' }); + +cordova.plugins.backgroundMode.onactivate = () => { } +cordova.plugins.backgroundMode.ondeactivate = () => { } +cordova.plugins.backgroundMode.onfailure = (errorCode) => { } \ No newline at end of file diff --git a/cordova-plugin-background-mode/cordova-plugin-background-mode.d.ts b/cordova-plugin-background-mode/cordova-plugin-background-mode.d.ts new file mode 100644 index 0000000000..48a1be08c2 --- /dev/null +++ b/cordova-plugin-background-mode/cordova-plugin-background-mode.d.ts @@ -0,0 +1,76 @@ +// Type definitions for Apache Background Mode plugin +// Project: https://github.com/katzer/cordova-plugin-background-mode +// Definitions by: Paul Thiel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * The plugin prevent the app from going to sleep while in background + */ +interface CordovaPluginBackgroundMode { + + /** + * The background mode can be enabled + */ + enable(): void; + /** + * The background mode can be disabled + */ + disable(): void; + /** + * Checks if the background mode is enabled or not + */ + isEnabled(): boolean; + /** + * Checks if the background mode is activated or not + */ + isActivated(): boolean; + /** + * Function to get notified when the background mode has been activated + */ + onactivate(): void; + /** + * Function to get notified when the background mode has been deactivated + */ + ondeactivate(): void; + /** + * Function to get notified when the background could not benn activated + */ + onfailure(callback: (errorCode: number) => void): void; + /** + * Customize default title, ticker and text for the notification + */ + setDefaults(item: ICordovaPluginBackgroundModeNotificationItem): void; + /** + * Configure the default background notification + */ + configure(item: ICordovaPluginBackgroundModeNotificationItem): void; +} + +interface ICordovaPluginBackgroundModeNotificationItem { + + /** + * The title of the notification displayed in background mode + */ + title?: string, + /** + * The ticker of the notification displayed in background mode + */ + ticker?: string, + /** + * The body of the notification displayed in background mode + */ + text?: string, + /** + * Handles if app is coming to foreground when tapping on the notification + */ + resume?: boolean, + /** + * Handles if there is a notification when background is activated + */ + silent?: boolean +} + +interface CordovaPlugins { + + backgroundMode: CordovaPluginBackgroundMode +} \ No newline at end of file diff --git a/devextreme/devextreme-15.2.7.d.ts b/devextreme/devextreme-15.2.7.d.ts new file mode 100644 index 0000000000..df967b19f3 --- /dev/null +++ b/devextreme/devextreme-15.2.7.d.ts @@ -0,0 +1,7429 @@ +// Type definitions for DevExtreme 15.2.7 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object) : void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): JQueryPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): JQueryPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare namespace DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends EditorOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + onContentReady?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + /** The "mode" attribute value of the actual HTML input element representing the widget. */ + mode?: string; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormEmptyItem extends dxFormItem { + /** Specifies the form item name. */ + name?: string; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifies which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + /** Specifies a badge text for the tab. */ + badge?: string; + /** A Boolean value specifying whether or not the tab can respond to user interaction. */ + disabled?: boolean; + /** Specifies the icon to be displayed on the tab. */ + icon?: string; + /** The template to be used for rendering the tab. */ + tabTemplate?: any; + /** The template to be used for rendering the tab content. */ + template?: any; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for required fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies the message that is shown for end-users a required field value is not specified. */ + requiredMessage?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + onContentReady?: Function; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxForm): JQuery; +} + +declare namespace DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare namespace DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the initial sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Specifies the data field against which the header items of this field should be sorted. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare namespace DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurrent appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of an appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of an appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of an appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time. */ + scrollToTime(hours: number, minutes: number): void; + /** Displays the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode option instead. + */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode option instead. + */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay in submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridRow { + /** The data object represented by the row. */ + data: Object; + /** The key of the data object represented by the row. */ + key: any; + /** The visible index of the row. */ + rowIndex: number; + /** The type of the row. */ + rowType: string; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for the header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** The Load panel configuration options. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + cancel: boolean; + }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare namespace DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare namespace DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions extends DOMComponentOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare namespace DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated use the 'innerRadius' option instead + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated use the 'segmentsDirection' option instead + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated use the 'startAngle' option instead + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated use the 'type' option instead + */ + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated use the 'type' option instead + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: AxisTitle; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair labels. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + }; + /** Specifies a default pane for the chart's series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + /** Specifies the format of the values displayed by crosshair labels. */ + format?: string; + /** Specifies a precision for formatted values. */ + precision?: number; + /** Customizes the text displayed by the crosshair label that accompany the horizontal line. */ + customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare namespace DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare namespace DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated ..\tickInterval\tickInterval.md + */ + majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated minorTick\visible.md + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + /** Specifies options of the range selector's minor ticks. */ + minorTick?: { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare namespace DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ + export interface Area { + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ + text: string; + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + data?: any; + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare namespace DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index df967b19f3..3a7d42e05a 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,11 +1,11 @@ -// Type definitions for DevExtreme 15.2.7 +// Type definitions for DevExtreme 15.2.9 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare namespace DevExpress { +declare module DevExpress { /** A mixin that provides a capability to fire and subscribe to events. */ export interface EventsMixin { /** Subscribes to a specified event. */ @@ -427,6 +427,9 @@ declare namespace DevExpress { /** A handler for the loadError event. */ onLoadError?: (e?: Error) => void; } + export interface OperationPromise extends JQueryPromise { + operationId: number; + } /** An object that provides access to a data web service or local data storage for collection container widgets. */ export class DataSource implements EventsMixin { constructor(url: string); @@ -454,9 +457,9 @@ declare namespace DevExpress { /** Returns the key expression. */ key(): any; /** Starts loading data. */ - load(): JQueryPromise>; + load(): OperationPromise>; /** Clears currently loaded DataSource items and calls the load() method. */ - reload(): JQueryPromise>; + reload(): OperationPromise>; /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ loadOptions(): Object; /** Returns the current pageSize option value. */ @@ -499,6 +502,7 @@ declare namespace DevExpress { store(): Store; /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ totalCount(): number; + cancel(operationId: number): boolean; on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; on(eventName: "changed", eventHandler: () => void): DataSource; @@ -831,7 +835,7 @@ declare namespace DevExpress { export function registerPalette(paletteName: string, palette: Object): void; } } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxValidatorOptions extends DOMComponentOptions { /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ validationRules?: Array; @@ -1369,7 +1373,7 @@ declare namespace DevExpress.ui { constructor(element: Element, options?: dxMultiViewOptions); } export interface dxMapOptions extends WidgetOptions { - /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */ + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */ autoAdjust?: boolean; center?: { /** The latitude location displayed in the center of the widget. */ @@ -2157,7 +2161,7 @@ declare namespace DevExpress.ui { requiredMark?: string; /** The text displayed for optional fields. */ optionalMark?: string; - /** Specifies the message that is shown for end-users a required field value is not specified. */ + /** Specifies the message that is shown for end-users if a required field value is not specified. */ requiredMessage?: string; /** Specifies whether or not the total validation summary is displayed on the form. */ showValidationSummary?: boolean; @@ -2406,10 +2410,10 @@ interface JQuery { dxForm(options: "instance"): DevExpress.ui.dxForm; dxForm(options: string): any; dxForm(options: string, ...params: any[]): any; - dxForm(options: DevExpress.ui.dxForm): JQuery; + dxForm(options: DevExpress.ui.dxFormOptions): JQuery; } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxTileViewOptions extends CollectionWidgetOptions { /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ activeStateEnabled?: boolean; @@ -2646,7 +2650,7 @@ interface JQuery { dxDropDownMenu(options: string, ...params: any[]): any; dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; } -declare namespace DevExpress.data { +declare module DevExpress.data { export interface XmlaStoreOptions { /** The HTTP address to an XMLA OLAP server. */ url?: string; @@ -2693,11 +2697,11 @@ declare namespace DevExpress.data { groupName?: string; /** The index of the field within a group. */ groupIndex?: number; - /** Specifies the initial sort order of field values. */ + /** Specifies the sort order of field values. */ sortOrder?: string; /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ sortBy?: string; - /** Specifies the data field against which the header items of this field should be sorted. */ + /** Sorts the header items of this field by the summary values of another field. */ sortBySummaryField?: string; /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ sortBySummaryPath?: Array; @@ -2843,7 +2847,7 @@ declare namespace DevExpress.data { off(eventName: string, eventHandler: Function): PivotGridDataSource; } } -declare namespace DevExpress.ui { +declare module DevExpress.ui { export interface dxSchedulerOptions extends WidgetOptions { /** Specifies a date displayed on the current scheduler view by default. */ currentDate?: Date; @@ -2873,7 +2877,7 @@ declare namespace DevExpress.ui { showAllDayPanel?: boolean; /** Specifies cell duration in minutes. */ cellDuration?: number; - /** Specifies the edit mode for recurrent appointments. */ + /** Specifies the edit mode for recurring appointments. */ recurrenceEditMode?: string; /** Specifies which editing operations an end-user can perform on appointments. */ editing?: { @@ -2963,10 +2967,10 @@ declare namespace DevExpress.ui { updateAppointment(target: Object, appointment: Object): void; /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ deleteAppointment(appointment: Object): void; - /** Scrolls the scheduler work space to the specified time. */ - scrollToTime(hours: number, minutes: number): void; - /** Displays the Appointment Details popup. */ - showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; + /** Scrolls the scheduler work space to the specified time of the specified day. */ + scrollToTime(hours: number, minutes: number, date: Date): void; + /** Displayes the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void; } export interface dxColorBoxOptions extends dxDropDownEditorOptions { /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ @@ -3771,6 +3775,8 @@ declare namespace DevExpress.ui { summaryType?: string; /** Specifies a format for the summary item value. */ valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; }>; /** Specifies items of the total summary. */ totalItems?: Array<{ @@ -3797,7 +3803,11 @@ declare namespace DevExpress.ui { summaryType?: string; /** Specifies a format for the summary item value. */ valueFormat?: string; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; }>; + /** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */ + skipEmptyValues?: boolean; /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ calculateCustomSummary?: (options: { component: dxDataGrid; @@ -4037,7 +4047,7 @@ declare namespace DevExpress.ui { /** The string to display as an Export to Excel file context menu item. */ exportToExcel?: string; }; - /** The Load panel configuration options. */ + /** Specifies options configuring the load panel. */ loadPanel?: { /** Enables or disables the load panel. */ enabled?: boolean; @@ -4189,7 +4199,7 @@ interface JQuery { dxScheduler(options: string, ...params: any[]): any; dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; } -declare namespace DevExpress.framework { +declare module DevExpress.framework { /** An object used to store information on the views displayed in an application. */ export class ViewCache { viewRemoved: JQueryCallback; @@ -4471,7 +4481,7 @@ declare namespace DevExpress.framework { } } } -declare namespace DevExpress.viz.core { +declare module DevExpress.viz.core { /** * Applies a theme for the entire page with several DevExtreme visualization widgets. * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. @@ -4707,7 +4717,7 @@ declare namespace DevExpress.viz.core { svg(): string; } } -declare namespace DevExpress.viz.charts { +declare module DevExpress.viz.charts { /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ export interface BaseSeries { /** Provides information about the state of the series object. */ @@ -5738,6 +5748,8 @@ declare namespace DevExpress.viz.charts { equalBarWidth?: boolean; /** Specifies a common bar width as a percentage from 0 to 1. */ barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5799,7 +5811,7 @@ declare namespace DevExpress.viz.charts { customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string; } }; - /** Specifies a default pane for the chart's series. */ + /** Specifies a default pane for the chart series. */ defaultPane?: string; /** Specifies a coefficient determining the diameter of the largest bubble. */ maxBubbleSize?: number; @@ -5956,7 +5968,7 @@ interface JQuery { dxPolarChart(methodName: string, ...params: any[]): any; dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; } -declare namespace DevExpress.viz.gauges { +declare module DevExpress.viz.gauges { export interface BaseRangeContainer { /** Specifies a range container's background color. */ backgroundColor?: string; @@ -6373,7 +6385,7 @@ interface JQuery { dxBarGauge(methodName: string, ...params: any[]): any; dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; } -declare namespace DevExpress.viz.rangeSelector { +declare module DevExpress.viz.rangeSelector { export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { /** Specifies the options for the range selector's background. */ background?: { @@ -6425,6 +6437,8 @@ declare namespace DevExpress.viz.rangeSelector { equalBarWidth?: boolean; /** Specifies a common bar width as a percentage from 0 to 1. */ barWidth?: number; + /** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ + negativesAsZeroes?: boolean; /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ palette?: any; /** An object defining the chart’s series. */ @@ -6667,7 +6681,7 @@ interface JQuery { dxRangeSelector(methodName: string, ...params: any[]): any; dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; } -declare namespace DevExpress.viz.map { +declare module DevExpress.viz.map { /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ export interface MapLayer { /** The name of the layer. */ @@ -7306,7 +7320,7 @@ interface JQuery { dxVectorMap(methodName: string, ...params: any[]): any; dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; } -declare namespace DevExpress.viz.sparklines { +declare module DevExpress.viz.sparklines { export interface SparklineTooltip extends viz.core.Tooltip { /** * Specifies how a tooltip is horizontally aligned relative to the graph. diff --git a/dom4/dom4.d.ts b/dom4/dom4.d.ts index 6139a6f7ea..5c6538e5b3 100644 --- a/dom4/dom4.d.ts +++ b/dom4/dom4.d.ts @@ -9,21 +9,6 @@ interface ParentNode { */ children: HTMLCollection; - /** - * Returns the first child that is an element, and null otherwise. - */ - firstElementChild: Element; - - /** - * Returns the last child that is an element, and null otherwise. - */ - lastElementChild: Element; - - /** - * Returns the number of children that are elements. - */ - childElementCount: number; - /** * Returns the first element that is a descendant of node that matches relativeSelectors. */ @@ -47,11 +32,11 @@ interface Element extends ParentNode { matches(selectors: string): boolean; } -interface Elements extends ParentNode, Array { +interface Elements extends ElementTraversal, ParentNode, Array { } -interface Document extends ParentNode { +interface Document extends ElementTraversal, ParentNode { } -interface DocumentFragment extends ParentNode { +interface DocumentFragment extends ElementTraversal, ParentNode { } diff --git a/dropzone/dropzone-commonjs-tests.ts b/dropzone/dropzone-commonjs-tests.ts index c25b339e87..8b5fd0a693 100644 --- a/dropzone/dropzone-commonjs-tests.ts +++ b/dropzone/dropzone-commonjs-tests.ts @@ -4,6 +4,9 @@ import Dropzone = require("dropzone"); const dropzoneFromString = new Dropzone(".test"); const dropzoneFromElement = new Dropzone(document.getElementById("test")); +const dropzoneRenameFunction = function(name: string){ + return name; +}; const dropzoneWithOptions = new Dropzone(".test", { url: "/some/url", @@ -25,10 +28,12 @@ const dropzoneWithOptions = new Dropzone(".test", { clickable: true, ignoreHiddenFiles: true, acceptedFiles: "image/*", + renameFilename: dropzoneRenameFunction, autoProcessQueue: true, autoQueue: true, addRemoveLinks: true, previewsContainer: "
", + hiddenInputContainer: document.createElement("input"), capture: "camera", dictDefaultMessage: "", diff --git a/dropzone/dropzone-tests.ts b/dropzone/dropzone-tests.ts index 3893f7c1a1..249d90a707 100644 --- a/dropzone/dropzone-tests.ts +++ b/dropzone/dropzone-tests.ts @@ -2,6 +2,9 @@ const dropzoneFromString = new Dropzone(".test"); const dropzoneFromElement = new Dropzone(document.getElementById("test")); +const dropzoneRenameFunction = function (name:string):string { + return name + 'new'; +}; const dropzoneWithOptions = new Dropzone(".test", { url: "/some/url", @@ -26,10 +29,12 @@ const dropzoneWithOptions = new Dropzone(".test", { clickable: true, ignoreHiddenFiles: true, acceptedFiles: "image/*", + renameFilename: dropzoneRenameFunction, autoProcessQueue: true, autoQueue: true, addRemoveLinks: true, previewsContainer: "
", + hiddenInputContainer: document.createElement("input"), capture: "camera", dictDefaultMessage: "", diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index 788cdc08e6..7464151b3b 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Dropzone 4.0.1 +// Type definitions for Dropzone 4.3.0 // Project: http://www.dropzonejs.com/ -// Definitions by: Natan Vivo , Andy Hawkins , Vasya Aksyonov +// Definitions by: Natan Vivo , Andy Hawkins , Vasya Aksyonov , Simon Huber // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -45,10 +45,12 @@ interface DropzoneOptions { clickable?: boolean|string|HTMLElement|(string|HTMLElement)[]; ignoreHiddenFiles?: boolean; acceptedFiles?: string; + renameFilename?(name:string): string; autoProcessQueue?: boolean; autoQueue?: boolean; addRemoveLinks?: boolean; previewsContainer?: boolean|string|HTMLElement; + hiddenInputContainer?: HTMLElement; capture?: string; dictDefaultMessage?: string; diff --git a/electron/github-electron-main-tests.ts b/electron/github-electron-main-tests.ts index b8b95c5c99..1366a82022 100644 --- a/electron/github-electron-main-tests.ts +++ b/electron/github-electron-main-tests.ts @@ -340,11 +340,15 @@ win.show(); // content-tracing // https://github.com/atom/electron/blob/master/docs/api/content-tracing.md -contentTracing.startRecording('*', contentTracing.DEFAULT_OPTIONS, () => { - console.log('Tracing started'); +const options = { + categoryFilter: '*', + traceOptions: 'record-until-full,enable-sampling' +} - setTimeout(() => { - contentTracing.stopRecording('', path => { +contentTracing.startRecording(options, function() { + console.log('Tracing started'); + setTimeout(function() { + contentTracing.stopRecording('', function(path) { console.log('Tracing data recorded to ' + path); }); }, 5000); @@ -408,7 +412,7 @@ var menuItem = new MenuItem({}); menuItem.label = 'Hello World!'; menuItem.click = (menuItem, browserWindow) => { - console.log('click', menuItem, browserWindow); + console.log('click', menuItem, browserWindow); }; // menu @@ -644,7 +648,7 @@ app.on('ready', () => { appIcon.setToolTip('This is my application.'); appIcon.setContextMenu(contextMenu); appIcon.setImage('/path/to/new/icon'); - appIcon.popUpContextMenu(contextMenu, {x: 100, y: 100}); + appIcon.popUpContextMenu(contextMenu, {x: 100, y: 100}); appIcon.on('click', (event, bounds) => { console.log('click', event, bounds); @@ -745,7 +749,7 @@ shell.openItem('/home/user/Desktop/test.txt'); shell.moveItemToTrash('/home/user/Desktop/test.txt'); shell.openExternal('https://github.com', { - activate: false + activate: false }); shell.beep(); @@ -775,7 +779,7 @@ session.defaultSession.cookies.get({ url : "http://www.github.com" }, (error, co var cookie = { url : "http://www.github.com", name : "dummy_name", value : "dummy" }; session.defaultSession.cookies.set(cookie, (error) => { if (error) { - console.error(error); + console.error(error); } }); @@ -815,3 +819,24 @@ session.defaultSession.enableNetworkEmulation({ session.defaultSession.setCertificateVerifyProc((hostname, cert, callback) => { callback((hostname === 'github.com') ? true : false); }); + +session.defaultSession.setPermissionRequestHandler(function(webContents, permission, callback) { + if (webContents.getURL() === 'github.com') { + if (permission == "notifications") { + callback(false); + return; + } + } + + callback(true); +}); + +// Modify the user agent for all requests to the following urls. +var filter = { + urls: ["https://*.github.com/*", "*://electron.github.io"] +}; + +session.defaultSession.webRequest.onBeforeSendHeaders(filter, function(details, callback) { + details.requestHeaders['User-Agent'] = "MyAgent"; + callback({cancel: false, requestHeaders: details.requestHeaders}); +}); diff --git a/electron/github-electron.d.ts b/electron/github-electron.d.ts index 9ae82d6988..ec53909d50 100644 --- a/electron/github-electron.d.ts +++ b/electron/github-electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v0.37.4 +// Type definitions for Electron v0.37.6 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd , Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,7 +25,7 @@ declare namespace Electron { sender: EventEmitter; } - // https://github.com/atom/electron/blob/master/docs/api/app.md + // https://github.com/electron/electron/blob/master/docs/api/app.md /** * The app module is responsible for controlling the application's lifecycle. @@ -319,7 +319,7 @@ declare namespace Electron { * * Note: This will not affect process.argv. */ - appendArgument(value: any): void; + appendArgument(value: string): void; } interface Dock { @@ -411,7 +411,7 @@ declare namespace Electron { iconIndex?: number; } - // https://github.com/atom/electron/blob/master/docs/api/auto-updater.md + // https://github.com/electron/electron/blob/master/docs/api/auto-updater.md /** * This module provides an interface for the Squirrel auto-updater framework. @@ -448,7 +448,7 @@ declare namespace Electron { * Ask the server whether there is an update, you have to call setFeedURL * before using this API */ - checkForUpdates(): any; + checkForUpdates(): void; /** * Restarts the app and installs the update after it has been downloaded. * It should only be called after update-downloaded has been emitted. @@ -456,7 +456,7 @@ declare namespace Electron { quitAndInstall(): void; } - // https://github.com/atom/electron/blob/master/docs/api/browser-window.md + // https://github.com/electron/electron/blob/master/docs/api/browser-window.md /** * The BrowserWindow class gives you ability to create a browser window. @@ -1132,6 +1132,11 @@ declare namespace Electron { * Default: ISO-8859-1. */ defaultEncoding?: string; + /** + * Whether to throttle animations and timers when the page becomes background. + * Default: true + */ + backgroundThrottling?: boolean; } interface BrowserWindowOptions extends Rectangle { @@ -1282,7 +1287,7 @@ declare namespace Electron { enableLargerThanScreen?: boolean; /** * Window’s background color as Hexadecimal value, like #66CD00 or #FFF or #80FFFFFF (alpha is supported). - * Default: #000 (black) for Linux and Windows, #FFF for Mac (or clear if transparent). + * Default: #FFF (white). */ backgroundColor?: string; /** @@ -1327,7 +1332,7 @@ declare namespace Electron { height?: number; } - // https://github.com/atom/electron/blob/master/docs/api/clipboard.md + // https://github.com/electron/electron/blob/master/docs/api/clipboard.md /** * The clipboard module provides methods to perform copy and paste operations. @@ -1383,7 +1388,7 @@ declare namespace Electron { * Reads the data in the clipboard of the specified format. * Note: This API is experimental and could be removed in future. */ - read(format: string, type?: ClipboardType): any; + read(format: string, type?: ClipboardType): string | NativeImage; /** * Writes data to the clipboard. */ @@ -1397,7 +1402,7 @@ declare namespace Electron { type ClipboardType = '' | 'selection'; - // https://github.com/atom/electron/blob/master/docs/api/content-tracing.md + // https://github.com/electron/electron/blob/master/docs/api/content-tracing.md /** * The content-tracing module is used to collect tracing data generated by the underlying Chromium content module. @@ -1407,47 +1412,40 @@ declare namespace Electron { interface ContentTracing { /** * Get a set of category groups. The category groups can change as new code paths are reached. - * @param callback Called once all child processes have acked to the getCategories request. + * + * @param callback Called once all child processes have acknowledged the getCategories request. */ - getCategories(callback: (categoryGroups: any[]) => void): void; + getCategories(callback: (categoryGroups: string[]) => void): void; /** - * Start recording on all processes. Recording begins immediately locally, and asynchronously + * Start recording on all processes. Recording begins immediately locally and asynchronously * on child processes as soon as they receive the EnableRecording request. - * @param categoryFilter A filter to control what category groups should be traced. - * A filter can have an optional "-" prefix to exclude category groups that contain - * a matching category. Having both included and excluded category patterns in the - * same list would not be supported. - * @param options controls what kind of tracing is enabled, it could be a OR-ed - * combination of tracing.DEFAULT_OPTIONS, tracing.ENABLE_SYSTRACE, tracing.ENABLE_SAMPLING - * and tracing.RECORD_CONTINUOUSLY. - * @param callback Called once all child processes have acked to the startRecording request. + * + * @param callback Called once all child processes have acknowledged the startRecording request. */ - startRecording(categoryFilter: string, options: number, callback: Function): void; + startRecording(options: ContentTracingOptions, callback: Function): void; /** * Stop recording on all processes. Child processes typically are caching trace data and * only rarely flush and send trace data back to the main process. That is because it may * be an expensive operation to send the trace data over IPC, and we would like to avoid * much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all * child processes to flush any pending trace data. + * * @param resultFilePath Trace data will be written into this file if it is not empty, * or into a temporary file. - * @param callback Called once all child processes have acked to the stopRecording request. + * @param callback Called once all child processes have acknowledged the stopRecording request. */ - stopRecording(resultFilePath: string, callback: - /** - * @param filePath A file that contains the traced data. - */ - (filePath: string) => void - ): void; + stopRecording(resultFilePath: string, callback: (filePath: string) => void): void; /** - * Start monitoring on all processes. Monitoring begins immediately locally, and asynchronously + * Start monitoring on all processes. Monitoring begins immediately locally and asynchronously * on child processes as soon as they receive the startMonitoring request. + * * @param callback Called once all child processes have acked to the startMonitoring request. */ - startMonitoring(categoryFilter: string, options: number, callback: Function): void; + startMonitoring(options: ContentTracingOptions, callback: Function): void; /** * Stop monitoring on all processes. - * @param callback Called once all child processes have acked to the stopMonitoring request. + * + * @param callback Called once all child processes have acknowledged the stopMonitoring request. */ stopMonitoring(callback: Function): void; /** @@ -1456,17 +1454,13 @@ declare namespace Electron { * be an expensive operation to send the trace data over IPC, and we would like to avoid much * runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child * processes to flush any pending trace data. - * @param callback Called once all child processes have acked to the captureMonitoringSnapshot request. + * + * @param callback Called once all child processes have acknowledged the captureMonitoringSnapshot request. */ - captureMonitoringSnapshot(resultFilePath: string, callback: - /** - * @param filePath A file that contains the traced data - * @returns {} - */ - (filePath: string) => void - ): void; + captureMonitoringSnapshot(resultFilePath: string, callback: (filePath: string) => void): void; /** - * Get the maximum across processes of trace buffer percent full state. + * Get the maximum usage across processes of trace buffer as a percentage of the full state. + * * @param callback Called when the TraceBufferUsage value is determined. */ getTraceBufferUsage(callback: Function): void; @@ -1475,16 +1469,47 @@ declare namespace Electron { */ setWatchEvent(categoryName: string, eventName: string, callback: Function): void; /** - * Cancel the watch event. If tracing is enabled, this may race with the watch event callback. + * Cancel the watch event. This may lead to a race condition with the watch event callback if tracing is enabled. */ cancelWatchEvent(): void; - DEFAULT_OPTIONS: number; - ENABLE_SYSTRACE: number; - ENABLE_SAMPLING: number; - RECORD_CONTINUOUSLY: number; } - // https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md + interface ContentTracingOptions { + /** + * Filter to control what category groups should be traced. + * A filter can have an optional - prefix to exclude category groups + * that contain a matching category. Having both included and excluded + * category patterns in the same list is not supported. + * + * Examples: + * test_MyTest* + * test_MyTest*,test_OtherStuff + * -excluded_category1,-excluded_category2 + */ + categoryFilter: string; + /** + * Controls what kind of tracing is enabled, it is a comma-delimited list. + * + * Possible options are: + * record-until-full + * record-continuously + * trace-to-console + * enable-sampling + * enable-systrace + * + * The first 3 options are trace recoding modes and hence mutually exclusive. + * If more than one trace recording modes appear in the traceOptions string, + * the last one takes precedence. If none of the trace recording modes are specified, + * recording mode is record-until-full. + * + * The trace option will first be reset to the default option (record_mode set + * to record-until-full, enable_sampling and enable_systrace set to false) + * before options parsed from traceOptions are applied on it. + */ + traceOptions: string; + } + + // https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md /** * The crash-reporter module enables sending your app's crash reports. @@ -1492,87 +1517,56 @@ declare namespace Electron { interface CrashReporter { /** * You are required to call this method before using other crashReporter APIs. + * + * Note: On OS X, Electron uses a new crashpad client, which is different from breakpad + * on Windows and Linux. To enable the crash collection feature, you are required to call + * the crashReporter.start API to initialize crashpad in the main process and in each + * renderer process from which you wish to collect crash reports. */ start(options: CrashReporterStartOptions): void; /** - * @returns The date and ID of the last crash report. When there was no crash report + * @returns The crash report. When there was no crash report * sent or the crash reporter is not started, null will be returned. */ - getLastCrashReport(): CrashReporterPayload; + getLastCrashReport(): CrashReport; /** - * @returns All uploaded crash reports. Each report contains the date and uploaded ID. + * @returns All uploaded crash reports. */ - getUploadedReports(): CrashReporterPayload[]; + getUploadedReports(): CrashReport[]; } interface CrashReporterStartOptions { /** - * Default: Electron - */ + * Default: Electron + */ productName?: string; companyName: string; /** - * URL that crash reports would be sent to as POST. - */ + * URL that crash reports would be sent to as POST. + */ submitURL: string; /** - * Send the crash report without user interaction. - * Default: true. - */ + * Send the crash report without user interaction. + * Default: true. + */ autoSubmit?: boolean; /** - * Default: false. - */ + * Default: false. + */ ignoreSystemCrashHandler?: boolean; /** - * An object you can define which content will be send along with the report. - * Only string properties are send correctly. - * Nested objects are not supported. - */ + * An object you can define that will be sent along with the report. + * Only string properties are sent correctly, nested objects are not supported. + */ extra?: {[prop: string]: string}; } - interface CrashReporterPayload extends Object { - /** - * E.g., "electron-crash-service". - */ - rept: string; - /** - * The version of Electron. - */ - ver: string; - /** - * E.g., "win32". - */ - platform: string; - /** - * E.g., "renderer". - */ - process_type: string; - ptime: number; - /** - * The version in package.json. - */ - _version: string; - /** - * The product name in the crashReporter options object. - */ - _productName: string; - /** - * Name of the underlying product. In this case, Electron. - */ - prod: string; - /** - * The company name in the crashReporter options object. - */ - _companyName: string; - /** - * The crashreporter as a file. - */ - upload_file_minidump: File; + interface CrashReport { + id: string; + date: Date; } - // https://github.com/atom/electron/blob/master/docs/api/desktop-capturer.md + // https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md /** * The desktopCapturer module can be used to get available sources @@ -1585,7 +1579,7 @@ declare namespace Electron { * Note: There is no guarantee that the size of source.thumbnail is always * the same as the thumnbailSize in options. It also depends on the scale of the screen or window. */ - getSources(options: any, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void; + getSources(options: DesktopCapturerOptions, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void; } interface DesktopCapturerOptions { @@ -1618,7 +1612,7 @@ declare namespace Electron { thumbnail: NativeImage; } - // https://github.com/atom/electron/blob/master/docs/api/dialog.md + // https://github.com/electron/electron/blob/master/docs/api/dialog.md /** * The dialog module provides APIs to show native system dialogs, such as opening files or alerting, @@ -1660,13 +1654,13 @@ declare namespace Electron { * @param callback If supplied, the API call will be asynchronous. * @returns The index of the clicked button. */ - showMessageBox(browserWindow: BrowserWindow, options: ShowMessageBoxOptions, callback?: (response: any) => void): number; + showMessageBox(browserWindow: BrowserWindow, options: ShowMessageBoxOptions, callback?: (response: number) => void): number; /** * Shows a message box. It will block until the message box is closed. * @param callback If supplied, the API call will be asynchronous. * @returns The index of the clicked button. */ - showMessageBox(options: ShowMessageBoxOptions, callback?: (response: any) => void): number; + showMessageBox(options: ShowMessageBoxOptions, callback?: (response: number) => void): number; /** * Displays a modal dialog that shows an error message. * @@ -1752,7 +1746,7 @@ declare namespace Electron { noLink?: boolean; } - // https://github.com/atom/electron/blob/master/docs/api/download-item.md + // https://github.com/electron/electron/blob/master/docs/api/download-item.md /** * DownloadItem represents a download item in Electron. @@ -1820,7 +1814,7 @@ declare namespace Electron { getContentDisposition(): string; } - // https://github.com/atom/electron/blob/master/docs/api/global-shortcut.md + // https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md /** * The globalShortcut module can register/unregister a global keyboard shortcut @@ -1854,7 +1848,7 @@ declare namespace Electron { unregisterAll(): void; } - // https://github.com/atom/electron/blob/master/docs/api/ipc-main.md + // https://github.com/electron/electron/blob/master/docs/api/ipc-main.md /** * The ipcMain module handles asynchronous and synchronous messages @@ -1883,7 +1877,7 @@ declare namespace Electron { sender: WebContents; } - // https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md + // https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md /** * The ipcRenderer module provides a few methods so you can send synchronous @@ -1926,7 +1920,8 @@ declare namespace Electron { sender: IpcRenderer; } - // https://github.com/atom/electron/blob/master/docs/api/menu-item.md + // https://github.com/electron/electron/blob/master/docs/api/menu-item.md + // https://github.com/electron/electron/blob/master/docs/api/accelerator.md /** * The MenuItem allows you to add items to an application or context menu. @@ -1986,14 +1981,17 @@ declare namespace Electron { * multiple modifiers and key codes, combined by the + character. * * Examples: - * Command+A - * Ctrl+Shift+Z + * CommandOrControl+A + * CommandOrControl+Shift+Z * * Platform notice: * On Linux and Windows, the Command key would not have any effect, * you can use CommandOrControl which represents Command on OS X and Control on * Linux and Windows to define some accelerators. * + * Use Alt instead of Option. The Option key only exists on OS X, whereas + * the Alt key is available on all platforms. + * * The Super key is mapped to the Windows key on Windows and Linux and Cmd on OS X. * * Available modifiers: @@ -2031,8 +2029,17 @@ declare namespace Electron { * or NativeImage instances. When passing null, an empty image will be used. */ icon?: NativeImage|string; + /** + * If false, the menu item will be greyed out and unclickable. + */ enabled?: boolean; + /** + * If false, the menu item will be entirely hidden. + */ visible?: boolean; + /** + * Should only be specified for 'checkbox' or 'radio' type menu items. + */ checked?: boolean; /** * Should be specified for submenu type menu item, when it's specified the @@ -2055,7 +2062,7 @@ declare namespace Electron { role?: MenuItemRole | MenuItemRoleMac; } - // https://github.com/atom/electron/blob/master/docs/api/menu.md + // https://github.com/electron/electron/blob/master/docs/api/menu.md /** * The Menu class is used to create native menus that can be used as application @@ -2110,7 +2117,7 @@ declare namespace Electron { items: MenuItem[]; } - // https://github.com/atom/electron/blob/master/docs/api/native-image.md + // https://github.com/electron/electron/blob/master/docs/api/native-image.md /** * This class is used to represent an image. @@ -2158,7 +2165,7 @@ declare namespace Electron { /** * @returns {} The size of the image. */ - getSize(): any; + getSize(): Dimension; /** * Marks the image as template image. */ @@ -2169,7 +2176,7 @@ declare namespace Electron { isTemplateImage(): boolean; } - // https://github.com/atom/electron/blob/master/docs/api/power-monitor.md + // https://github.com/electron/electron/blob/master/docs/api/power-monitor.md /** * The power-monitor module is used to monitor power state changes. @@ -2195,7 +2202,7 @@ declare namespace Electron { on(event: string, listener: Function): this; } - // https://github.com/atom/electron/blob/master/docs/api/power-save-blocker.md + // https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md /** * The powerSaveBlocker module is used to block the system from entering @@ -2220,7 +2227,7 @@ declare namespace Electron { isStarted(id: number): boolean; } - // https://github.com/atom/electron/blob/master/docs/api/protocol.md + // https://github.com/electron/electron/blob/master/docs/api/protocol.md /** * The protocol module can register a custom protocol or intercept an existing protocol. @@ -2335,7 +2342,7 @@ declare namespace Electron { }): void; } - // https://github.com/atom/electron/blob/master/docs/api/remote.md + // https://github.com/electron/electron/blob/master/docs/api/remote.md /** * The remote module provides a simple way to do inter-process communication (IPC) @@ -2365,7 +2372,7 @@ declare namespace Electron { process: NodeJS.Process; } - // https://github.com/atom/electron/blob/master/docs/api/screen.md + // https://github.com/electron/electron/blob/master/docs/api/screen.md /** * The Display object represents a physical display connected to the system. @@ -2450,7 +2457,7 @@ declare namespace Electron { getDisplayMatching(rect: Bounds): Display; } - // https://github.com/atom/electron/blob/master/docs/api/session.md + // https://github.com/electron/electron/blob/master/docs/api/session.md /** * The session module can be used to create new Session objects. @@ -2504,7 +2511,7 @@ declare namespace Electron { /** * Resolves the proxy information for url. */ - resolveProxy(url: URL, callback: (proxy: any) => any): void; + resolveProxy(url: URL, callback: (proxy: string) => void): void; /** * Sets download saving directory. * By default, the download directory will be the Downloads under the respective app folder. @@ -2520,9 +2527,16 @@ declare namespace Electron { */ disableNetworkEmulation(): void; /** - * Sets the certificate verify proc for session. + * Sets the certificate verify proc for session, the proc will be called + * whenever a server certificate verification is requested. + * + * Calling setCertificateVerifyProc(null) will revert back to default certificate verify proc. */ - setCertificateVerifyProc(proc: CertificateVerifyProc): void; + setCertificateVerifyProc(proc: (hostname: string, cert: Certificate, callback: (accepted: boolean) => void) => void): void; + /** + * Sets the handler which can be used to respond to permission requests for the session. + */ + setPermissionRequestHandler(handler: (webContents: WebContents, permission: Permission, callback: (allow: boolean) => void) => void): void; /** * Clears the host resolver cache. */ @@ -2530,9 +2544,11 @@ declare namespace Electron { /** * The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime. */ - webRequest: any; + webRequest: WebRequest; } + type Permission = 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen'; + interface ClearStorageDataOptions { /** * Should follow window.location.origin’s representation scheme://host:port. @@ -2567,10 +2583,6 @@ declare namespace Electron { uploadThroughput?: number; } - interface CertificateVerifyProc { - (hostname: string, cert: any, callback: (accepted: boolean) => any): any; - } - interface CookieFilter { /** * Retrieves cookies which are associated with url. Empty implies retrieving cookies of all urls. @@ -2695,7 +2707,189 @@ declare namespace Electron { remove(url: string, name: string, callback: (error: Error) => void): void; } - // https://github.com/atom/electron/blob/master/docs/api/shell.md + /** + * Each API accepts an optional filter and a listener, the listener will be called when the API's event has happened. + * Passing null as listener will unsubscribe from the event. + * + * The filter will be used to filter out the requests that do not match the URL patterns. + * If the filter is omitted then all requests will be matched. + * + * For certain events the listener is passed with a callback, + * which should be called with an response object when listener has done its work. + */ + interface WebRequest { + /** + * The listener will be called when a request is about to occur. + */ + onBeforeRequest(listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; + /** + * The listener will be called when a request is about to occur. + */ + onBeforeRequest(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRequestDetails, callback: WebRequest.BeforeRequestCallback) => void): void; + /** + * The listener will be called before sending an HTTP request, once the request headers are available. + * This may occur after a TCP connection is made to the server, but before any http data is sent. + */ + onBeforeSendHeaders(listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; + /** + * The listener will be called before sending an HTTP request, once the request headers are available. + * This may occur after a TCP connection is made to the server, but before any http data is sent. + */ + onBeforeSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeSendHeadersDetails, callback: WebRequest.BeforeSendHeadersCallback) => void): void; + /** + * The listener will be called just before a request is going to be sent to the server, + * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. + */ + onSendHeaders(listener: (details: WebRequest.SendHeadersDetails) => void): void; + /** + * The listener will be called just before a request is going to be sent to the server, + * modifications of previous onBeforeSendHeaders response are visible by the time this listener is fired. + */ + onSendHeaders(filter: WebRequest.Filter, listener: (details: WebRequest.SendHeadersDetails) => void): void; + /** + * The listener will be called when HTTP response headers of a request have been received. + */ + onHeadersReceived(listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; + /** + * The listener will be called when HTTP response headers of a request have been received. + */ + onHeadersReceived(filter: WebRequest.Filter, listener: (details: WebRequest.HeadersReceivedDetails, callback: WebRequest.HeadersReceivedCallback) => void): void; + /** + * The listener will be called when first byte of the response body is received. + * For HTTP requests, this means that the status line and response headers are available. + */ + onResponseStarted(listener: (details: WebRequest.ResponseStartedDetails) => void): void; + /** + * The listener will be called when first byte of the response body is received. + * For HTTP requests, this means that the status line and response headers are available. + */ + onResponseStarted(filter: WebRequest.Filter, listener: (details: WebRequest.ResponseStartedDetails) => void): void; + /** + * The listener will be called when a server initiated redirect is about to occur. + */ + onBeforeRedirect(listener: (details: WebRequest.BeforeRedirectDetails) => void): void; + /** + * The listener will be called when a server initiated redirect is about to occur. + */ + onBeforeRedirect(filter: WebRequest.Filter, listener: (details: WebRequest.BeforeRedirectDetails) => void): void; + /** + * The listener will be called when a request is completed. + */ + onCompleted(listener: (details: WebRequest.CompletedDetails) => void): void; + /** + * The listener will be called when a request is completed. + */ + onCompleted(filter: WebRequest.Filter, listener: (details: WebRequest.CompletedDetails) => void): void; + /** + * The listener will be called when an error occurs. + */ + onErrorOccurred(listener: (details: WebRequest.ErrorOccurredDetails) => void): void; + /** + * The listener will be called when an error occurs. + */ + onErrorOccurred(filter: WebRequest.Filter, listener: (details: WebRequest.ErrorOccurredDetails) => void): void; + } + + namespace WebRequest { + interface Filter { + urls: string[]; + } + + interface Details { + id: number; + url: string; + method: string; + resourceType: string; + timestamp: number; + } + + interface UploadData { + /** + * Content being sent. + */ + bytes: Buffer; + /** + * Path of file being uploaded. + */ + file: string; + } + + interface BeforeRequestDetails extends Details { + uploadData?: UploadData[]; + } + + type BeforeRequestCallback = (response: { + cancel?: boolean; + /** + * The original request is prevented from being sent or completed, and is instead redirected to the given URL. + */ + redirectURL?: string; + }) => void; + + interface BeforeSendHeadersDetails extends Details { + requestHeaders: Headers; + } + + type BeforeSendHeadersCallback = (response: { + cancel?: boolean; + /** + * When provided, request will be made with these headers. + */ + requestHeaders?: Headers; + }) => void; + + interface SendHeadersDetails extends Details { + requestHeaders: Headers; + } + + interface HeadersReceivedDetails extends Details { + statusLine: string; + statusCode: number; + responseHeaders: Headers; + } + + type HeadersReceivedCallback = (response: { + cancel?: boolean; + /** + * When provided, the server is assumed to have responded with these headers. + */ + responseHeaders?: Headers; + /** + * Should be provided when overriding responseHeaders to change header status + * otherwise original response header's status will be used. + */ + statusLine?: string; + }) => void; + + interface ResponseStartedDetails extends Details { + responseHeaders: Headers; + fromCache: boolean; + statusCode: number; + statusLine: string; + } + + interface BeforeRedirectDetails extends Details { + redirectURL: string; + statusCode: number; + ip?: string; + fromCache: boolean; + responseHeaders: Headers; + } + + interface CompletedDetails extends Details { + responseHeaders: Headers; + fromCache: boolean; + statusCode: number; + statusLine: string; + } + + interface ErrorOccurredDetails extends Details { + fromCache: boolean; + error: string; + } + } + + // https://github.com/electron/electron/blob/master/docs/api/shell.md /** * The shell module provides functions related to desktop integration. @@ -2732,7 +2926,7 @@ declare namespace Electron { beep(): void; } - // https://github.com/atom/electron/blob/master/docs/api/tray.md + // https://github.com/electron/electron/blob/master/docs/api/tray.md /** * A Tray represents an icon in an operating system's notification area. @@ -2853,7 +3047,7 @@ declare namespace Electron { metaKey: boolean; } - // https://github.com/atom/electron/blob/master/docs/api/web-contents.md + // https://github.com/electron/electron/blob/master/docs/api/web-contents.md /** * A WebContents is responsible for rendering and controlling a web page. @@ -2868,7 +3062,7 @@ declare namespace Electron { * This event is like did-finish-load but emitted when the load failed or was cancelled, * e.g. window.stop() is invoked. */ - on(event: 'did-fail-load', listener: (event: Event, errorCode: number, errorDescription: string, validatedURL: string) => void): this; + on(event: 'did-fail-load', listener: (event: Event, errorCode: number, errorDescription: string, validatedURL: string, isMainFrame: boolean) => void): this; /** * Emitted when a frame has done navigation. */ @@ -2892,7 +3086,8 @@ declare namespace Electron { httpResponseCode: number, requestMethod: string, referrer: string, - headers: any + headers: Headers, + resourceType: string ) => void): this; /** * Emitted when a redirect is received while requesting a resource. @@ -2904,7 +3099,7 @@ declare namespace Electron { httpResponseCode: number, requestMethod: string, referrer: string, - headers: any + headers: Headers ) => void): this; /** * Emitted when the document in the given frame is loaded. @@ -3317,6 +3512,10 @@ declare namespace Electron { debugger: Debugger; } + interface Headers { + [key: string]: string; + } + type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other'; /** @@ -3452,7 +3651,7 @@ declare namespace Electron { /** * Coordinates of first match region. */ - selectionArea?: any; + selectionArea?: Bounds; } interface DeviceEmulationParameters { @@ -3564,7 +3763,7 @@ declare namespace Electron { on(event: string, listener: Function): this; } - // https://github.com/atom/electron/blob/master/docs/api/web-frame.md + // https://github.com/electron/electron/blob/master/docs/api/web-frame.md /** * The web-frame module allows you to customize the rendering of the current web page. @@ -3630,7 +3829,7 @@ declare namespace Electron { executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void; } - // https://github.com/atom/electron/blob/master/docs/api/web-view-tag.md + // https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md /** * Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. @@ -3934,7 +4133,7 @@ declare namespace Electron { * Fired when details regarding a requested resource is available. * status indicates socket connection to download the resource. */ - addEventListener(type: 'did-get-response-details', listener: (event: WebViewElement.DidGetResponseRetails) => void, useCapture?: boolean): void; + addEventListener(type: 'did-get-response-details', listener: (event: WebViewElement.DidGetResponseDetails) => void, useCapture?: boolean): void; /** * Fired when a redirect was received while requesting a resource. */ @@ -4056,27 +4255,29 @@ declare namespace Electron { interface LoadCommitEvent extends Event { url: string; - isMainFrame: string; + isMainFrame: boolean; } interface DidFailLoadEvent extends Event { errorCode: number; errorDescription: string; validatedURL: string; + isMainFrame: boolean; } interface DidFrameFinishLoadEvent extends Event { isMainFrame: boolean; } - interface DidGetResponseRetails extends Event { + interface DidGetResponseDetails extends Event { status: boolean; newURL: string; originalURL: string; httpResponseCode: number; requestMethod: string; referrer: string; - headers: any; + headers: Headers; + resourceType: string; } interface DidGetRedirectRequestEvent extends Event { @@ -4086,7 +4287,7 @@ declare namespace Electron { httpResponseCode: number; requestMethod: string; referrer: string; - headers: any; + headers: Headers; } interface PageTitleUpdatedEvent extends Event { @@ -4163,7 +4364,7 @@ declare namespace Electron { postMessage(message: string, targetOrigin: string): void; } - // https://github.com/atom/electron/blob/master/docs/api/synopsis.md + // https://github.com/electron/electron/blob/master/docs/api/synopsis.md interface CommonElectron { clipboard: Electron.Clipboard; @@ -4205,7 +4406,7 @@ interface Document { createElement(tagName: 'webview'): Electron.WebViewElement; } -// https://github.com/atom/electron/blob/master/docs/api/window-open.md +// https://github.com/electron/electron/blob/master/docs/api/window-open.md interface Window { /** @@ -4214,7 +4415,7 @@ interface Window { open(url: string, frameName?: string, features?: string): Electron.BrowserWindowProxy; } -// https://github.com/atom/electron/blob/master/docs/api/file-object.md +// https://github.com/electron/electron/blob/master/docs/api/file-object.md interface File { /** diff --git a/encoding-japanese/encoding-japanese-tests.ts b/encoding-japanese/encoding-japanese-tests.ts new file mode 100644 index 0000000000..2947d79a48 --- /dev/null +++ b/encoding-japanese/encoding-japanese-tests.ts @@ -0,0 +1,95 @@ +/// + +import * as Encoding from 'encoding-japanese'; + +// Convert character encoding to Shift_JIS from UTF-8. +var utf8Array_1 = new Uint8Array([1, 2, 3]); +var utf8Array_2 = [1, 2, 3]; +var utf8Array_3 = new Buffer([1, 2, 3]); +var sjisArray = Encoding.convert(utf8Array_1, 'SJIS', 'UTF8'); +var sjisArray = Encoding.convert(utf8Array_2, 'UTF16', 'UTF8'); +var sjisArray = Encoding.convert(utf8Array_3, 'EUCJP', 'UTF8'); + +// Convert character encoding by automatic detection (AUTO detect). +var utf8Array = utf8Array_1; +var sjisArray1 = Encoding.convert(utf8Array, 'SJIS'); +// or +var sjisArray2 = Encoding.convert(utf8Array, 'SJIS', 'AUTO'); + +// Detect the character encoding. +// The return value be one of the "Available Encodings" below. +var detected = Encoding.detect(utf8Array); +if (detected === 'UTF8') { + console.log('Encoding is UTF-8'); +} + +var sjisArray3 = Encoding.convert(utf8Array, { + to: 'SJIS', // to_encoding + from: 'UTF8' // from_encoding +}); + +var utf8String = 'ã\u0081\u0093ã\u0082\u0093ã\u0081«ã\u0081¡ã\u0081¯'; +var unicodeString = Encoding.convert(utf8String, { + to: 'UNICODE', + from: 'UTF8', + type: 'string' // Specify 'string' type. (Return as string) +}); +console.log(unicodeString); // こんにちは + +var utf16Array = Encoding.convert(utf8Array, { + to: 'UTF16', // to_encoding + from: 'UTF8', // from_encoding + bom: true // With BOM +}); + +var utf16leArray = Encoding.convert(utf8Array, { + to: 'UTF16', // to_encoding + from: 'UTF8', // from_encoding + bom: 'LE' // With BOM (little-endian) +}); + +var utf16beArray = Encoding.convert(utf8Array, { + to: 'UTF16BE', + from: 'UTF8' +}); + +// Detect character encoding by automatic. (AUTO detect). +var detected2 = Encoding.detect(utf8Array); +if (detected2 === 'UTF8') { + console.log('Encoding is UTF-8'); +} + +// Detect character encoding by specific encoding name. +var isSJIS = Encoding.detect(sjisArray, 'SJIS'); +if (isSJIS) { + console.log('Encoding is SJIS'); +} + +var sjisArray4 = [ + 130, 177, 130, 241, 130, 201, 130, 191, 130, 205, 129, + 65, 130, 217, 130, 176, 129, 153, 130, 210, 130, 230 +]; + +var encoded = Encoding.urlEncode(sjisArray4); +console.log(encoded); +// output: +// '%82%B1%82%F1%82%C9%82%BF%82%CD%81A%82%D9%82%B0%81%99%82%D2%82%E6' + +var decoded = Encoding.urlDecode(encoded); +console.log(decoded); +// output: [ +// 130, 177, 130, 241, 130, 201, 130, 191, 130, 205, 129, +// 65, 130, 217, 130, 176, 129, 153, 130, 210, 130, 230 +// ] + +var sjisArray5 = [ + 130, 177, 130, 241, 130, 201, 130, 191, 130, 205 +]; +var encoded2 = Encoding.base64Encode(sjisArray5); +console.log(encoded2); // 'grGC8YLJgr+CzQ==' + +var decoded2 = Encoding.base64Decode(encoded2); +console.log(decoded2); +// [130, 177, 130, 241, 130, 201, 130, 191, 130, 205] + + diff --git a/encoding-japanese/encoding-japanese.d.ts b/encoding-japanese/encoding-japanese.d.ts new file mode 100644 index 0000000000..0392926694 --- /dev/null +++ b/encoding-japanese/encoding-japanese.d.ts @@ -0,0 +1,49 @@ +// Type definitions for encoding-japanese v1.0.24 +// Project: https://github.com/polygonplanet/encoding.js +// Definitions by: rhysd +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "encoding-japanese" { + export type Encoding = + "UTF32" | "UTF16" | "UTF16BE" | + "UTF16LE" | "BINARY" | "ASCII" | + "JIS" | "UTF8" | "EUCJP" | + "SJIS" | "UNICODE" | "AUTO"; + type RawType = string | Uint8Array | number[] | Buffer; + + interface ConvertOptions { + to: Encoding; + from?: Encoding; + type?: "string" | "arraybuffer" | "array"; + bom?: boolean | string; + } + + export function detect(data: RawType, encodings?: Encoding | Encoding[]): Encoding; + export function convert(data: RawType, to: Encoding, from?: Encoding): number[]; + export function convert(data: RawType, options: ConvertOptions): string | ArrayBuffer | number[]; + export function urlEncode(data: number[] | Uint8Array): string; + export function urlDecode(data: string): number[]; + export function base64Encode(data: number[] | Uint8Array): string; + export function base64Decode(data: string): number[]; + export function codeToString(data: number[] | Uint8Array): string; + export function stringToCode(data: string): number[]; + export function toHankakuCase(data: number[]): number[]; + export function toHankakuCase(data: string): string; + export function toZenkakuCase(data: number[]): number[]; + export function toZenkakuCase(data: string): string; + export function toHiraganaCase(data: number[]): number[]; + export function toHiraganaCase(data: string): string; + export function toKatakanaCase(data: number[]): number[]; + export function toKatakanaCase(data: string): string; + export function toHankanaCase(data: number[]): number[]; + export function toHankanaCase(data: string): string; + export function toZenkanaCase(data: number[]): number[]; + export function toZenkanaCase(data: string): string; + export function toHankakuSpace(data: number[]): number[]; + export function toHankakuSpace(data: string): string; + export function toZenkakuSpace(data: number[]): number[]; + export function toZenkakuSpace(data: string): string; +} + diff --git a/express-useragent/express-useragent.d.ts b/express-useragent/express-useragent.d.ts index 4ea3d91d73..ddf8fdf13f 100644 --- a/express-useragent/express-useragent.d.ts +++ b/express-useragent/express-useragent.d.ts @@ -6,7 +6,16 @@ /// declare namespace Express { - interface ExpressUserAgent { + + interface Request { + useragent?: ExpressUseragent.UserAgent; + } +} + +declare namespace ExpressUseragent { + import express = Express; + + interface UserAgent { isMobile: boolean; isTablet: boolean; isiPad: boolean; @@ -55,14 +64,10 @@ declare namespace Express { source: string; } - interface Request { - useragent?: ExpressUserAgent; - } + function parse(source: string): UserAgent; + function express(): (req: express.Request, res: express.Response, next?: Function) => void; } declare module "express-useragent" { - import express = require("express"); - - export function parse(source: string): Express.ExpressUserAgent; - export function express(): (req: express.Request, res: express.Response, next?: Function) => void; + export = ExpressUseragent; } diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 93665b381f..52792a391f 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -179,6 +179,12 @@ declare namespace ExpressValidator { /** * Decode HTML entities */ + + /** + * Convert the input string to a date, or null if the input is not a date. + */ + toDate(): Sanitizer; + entityDecode(): Sanitizer; entityEncode(): Sanitizer; /** diff --git a/falcor-express/falcor-express-tests.ts b/falcor-express/falcor-express-tests.ts new file mode 100644 index 0000000000..ac018c30f8 --- /dev/null +++ b/falcor-express/falcor-express-tests.ts @@ -0,0 +1,25 @@ +/// +/// +/// +/// + +import express = require('express'); +import Router = require('falcor-router'); +import falcorExpress = require('falcor-express') + +const app = express(); +class MyRouter extends Router.createClass([{ + route: 'greeting', + get() { + return {json: {greeting: 'Hello, world'}}; + } +}]){ + constructor() { + super(); + } +} + +app.use('/model.json', falcorExpress.dataSourceRoute((req, res) => new MyRouter())); + +app.listen(3000); + diff --git a/falcor-express/falcor-express.d.ts b/falcor-express/falcor-express.d.ts new file mode 100644 index 0000000000..c5d638a107 --- /dev/null +++ b/falcor-express/falcor-express.d.ts @@ -0,0 +1,14 @@ +// Type definitions for falcor-express 0.1.2 +// Project: https://github.com/Netflix/falcor-express +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 'falcor-express' { + import {Request, Response, Handler} from 'express'; + import {DataSource} from 'falcor'; + function dataSourceRoute(getDataSource: (req: Request, res: Response) => DataSource): Handler; +} + diff --git a/falcor-http-datasource/falcor-http-datasource-tests.ts b/falcor-http-datasource/falcor-http-datasource-tests.ts new file mode 100644 index 0000000000..23d6f563b7 --- /dev/null +++ b/falcor-http-datasource/falcor-http-datasource-tests.ts @@ -0,0 +1,8 @@ +/// + +import HttpDataSource from 'falcor-http-datasource'; +import {Model} from 'falcor'; + +const model = new Model({ + source: new HttpDataSource('/model.json') +}); diff --git a/falcor-http-datasource/falcor-http-datasource.d.ts b/falcor-http-datasource/falcor-http-datasource.d.ts new file mode 100644 index 0000000000..920ec2e8d0 --- /dev/null +++ b/falcor-http-datasource/falcor-http-datasource.d.ts @@ -0,0 +1,23 @@ +// Type definitions for falcor-http-datasource 0.1.3 +// Project: https://github.com/Netflix/falcor-http-datasource +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace FalcorHttpDataSource { + + /** + * A HttpDataSource object is a {@link DataSource} can be used to retrieve data from a remote JSONGraph object using the browser's XMLHttpRequest. + **/ + class XMlHttpSource extends FalcorModel.DataSource { + constructor(jsonGraphUrl: string); + } +} + +declare module 'falcor-http-datasource' { + import XMlHttpSource = FalcorHttpDataSource.XMlHttpSource; + export {XMlHttpSource}; + export default XMlHttpSource; +} + diff --git a/falcor-json-graph/falcor-json-graph-tests.ts b/falcor-json-graph/falcor-json-graph-tests.ts new file mode 100644 index 0000000000..fcfada5fa9 --- /dev/null +++ b/falcor-json-graph/falcor-json-graph-tests.ts @@ -0,0 +1,39 @@ +/// + +import {Key, KeySet, Path, PathSet, ref, atom, error, pathValue, pathInvalidation} from 'falcor-json-graph'; + +const stringKey: Key = "productsById"; +const numberKey: Key = 10; +const booleanKey: Key = true; + +const keySet01: KeySet = stringKey; +const keySet02: KeySet = [stringKey]; +const KeySet03: KeySet = {from: 1, to: 10}; +const KeySet04: KeySet = ["name", {from: 0, length: 10}]; + +const path0: Path = ["productsById", "1234", "name"]; +const path1: Path = [stringKey, numberKey, booleanKey]; + +const pathSet01: PathSet = ["productsById", ["1234", "5678"], ["name", "price"]]; +const pathSet02: PathSet = ["products", [{from: 0, length: 10}, "length"], ["name", "price"]]; + +var ref01 = ref(['hoge']); +var ref02 = ref(['hoge'], {$expires: 1000}); +console.log(ref02.$type, ref02.value, ref02.$expires); + +var atom01 = atom('hoge'); +var atom02 = atom('hoge', {$expires: 1000}); +console.log(atom02.$type, atom02.value, atom02.$expires); + +var err01 = error('some error!'); +var err02 = error('some error!', {$expires: 1000}); +console.log(err02.$type === 'error', ref02.value, ref02.$expires); + +var pv01 = pathValue('hoge', 'FOO'); +var pv02 = pathValue('hoge[0].bar', 'FOO'); +var pv03 = pathValue('hoge[0...100].bar', 'FOO'); +var pv04 = pathValue(['hoge', {from: 0, to: 100}, 'bar'], 'FOO'); +console.log(pv04.path, pv04.value); + +var ip01 = pathInvalidation('hoge'); +console.log(ip01.path, ip01.invalidate); diff --git a/falcor-json-graph/falcor-json-graph.d.ts b/falcor-json-graph/falcor-json-graph.d.ts new file mode 100644 index 0000000000..7c42b654df --- /dev/null +++ b/falcor-json-graph/falcor-json-graph.d.ts @@ -0,0 +1,104 @@ +// Type definitions for falcor-json-graph 1.1.7 +// Project: https://github.com/Netflix/falcor-json-graph +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace FalcorJsonGraph { + + // NOTE: The following types are described at https://github.com/Netflix/falcor/tree/master/lib/typedefs . + + /** + * An atom allows you to treat a JSON value as atomic regardless of its type, ensuring that a JSON object or array is always returned in its entirety. The JSON value must be treated as immutable. Atoms can also be used to associate metadata with a JSON value. This metadata can be used to influence the way values are handled. + **/ + interface Atom extends Sentinel { + $type: 'atom'; + value: any; + } + + interface Error extends Sentinel { + $type: 'error'; + value: any; + } + + interface InvalidPath { + path: PathSet; + invalidate: boolean; + } + /** + * A part of a {@link Path} that can be any JSON value type. All types are coerced to string, except null. This makes the number 1 and the string "1" equivalent. + **/ + type Key = string | number | boolean; + + /** + * A part of a {@link PathSet} that can be either a {@link Key}, {@link Range}, or Array of either. + **/ + type KeySet = Key | Range | Array; + + /** + * An ordered list of {@link Key}s that point to a value in a {@link JSONGraph}. + **/ + type Path = Array; + + /** + * An ordered list of {@link KeySet}s that point to location(s) in the {@link JSONGraph}. It enables pointing to multiple locations in a more terse format than a set of {@link Path}s and is generally more efficient to evaluate. + **/ + type PathSet = Array; + + /** + * A wrapper around a path and its value. + **/ + interface PathValue { + path: string | PathSet; + value: any; + } + + /** + * An envelope that wraps a JSON object. + **/ + interface JSONEnvelope { + json: T; + } + + /** + * JavaScript Object Notation Graph (JSONGraph) is a notation for expressing graphs in JSON. For more information, see the [JSONGraph Guide]{@link http://netflix.github.io/falcor/documentation/jsongraph.html}. + **/ + type JSONGraph = any; + + /** + * An envelope that wraps a {@link JSONGraph} fragment. + **/ + interface JSONGraphEnvelope { + jsonGraph: JSONGraph; + paths?: Array; + invalidate?: Array; + } + + /** + * Describe a range of integers. Must contain either a "to" or "length" property. + **/ + interface Range { + from?: number; + to?: number; + length?: number; + } + + interface Reference extends Sentinel { + $type: 'reference'; + value: Path; + } + + interface Sentinel { + $expires?: number; + } + + function ref(path: string | FalcorJsonGraph.PathSet, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Reference; + function atom (value: any, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Atom; + function error(errorValue: any, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Error; + function pathValue(path: string | FalcorJsonGraph.PathSet, value: any): FalcorJsonGraph.PathValue; + function pathInvalidation(path: string | FalcorJsonGraph.PathSet): FalcorJsonGraph.InvalidPath; +} + +declare module 'falcor-json-graph' { + export = FalcorJsonGraph; +} + diff --git a/falcor-router/falcor-router-tests.ts b/falcor-router/falcor-router-tests.ts new file mode 100644 index 0000000000..ff47512eb7 --- /dev/null +++ b/falcor-router/falcor-router-tests.ts @@ -0,0 +1,102 @@ +/// + +import falcor = require('falcor'); +import Router = require('falcor-router'); + +new Router([]); +new Router([], {}); +new Router([], {debug: true}); +new Router([], {maxPaths: 10}); +new Router([], {maxRefFollow: 10}); +new Router([{route: "greeting", get: () =>({path:["greeting"], value: "Hello World"})}]); + +new falcor.Model({source: new Router([])}); + +class MyRouter extends Router.createClass([]) { + constructor() { + super({debug: true, maxPaths: 10, maxRefFollow: 10}); + } +} +new falcor.Model({source: new MyRouter()}); + +new Router([{ + route: 'todos.length', + get() { + return {path: 'todos.length', value: 10}; + }, +}]); + +new Router([{ + route: 'todos.length', + get() { + return [{path: 'todos.length', value: 10}]; + }, +}]); + +new Router([{ + route: 'todos.length', + get() { + return {json: { todos: {length : 10}}}; + } +}]); + +new Router([{ + route: 'todos.length', + get() { + return new Promise(resolve => { + resolve({path: 'todos.length', value: 10}); + }); + }, +}]); + +new Router([{ + route: 'todos.length', + get() { + return new Promise(resolve => { + resolve([{path: 'todos.length', value: 10}]); + }); + }, +}]); + +new Router([{ + route: 'todos.length', + get() { + return new Promise>(resolve => { + resolve({json: { todos: {length : 10}}}); + }); + } +}]); + +new Router([{ + route: 'todos[{integers:indicies}]', + get(pathset: FalcorRouter.RoutePathSet & {indicies: number[]}) { + return pathset.indicies.map(idx => { + const id = 'id' + idx; + return { + path: `todos[${idx}]`, + value: { + $type: 'ref', + value: `todosById.${id}` + } + } + }); + } +}]); + +new Router([{ + route: 'todos[{integers:number}]', + set(jsonGraph) { + return {json: jsonGraph}; + } +}]); + +new Router([{ + route: 'todos.push', + call(callpath, args) { + return [ + {path: 'json.todos.length', value: 11}, + {path: 'json.todos[10].name', value: args[0].name} + ]; + } +}]); + diff --git a/falcor-router/falcor-router.d.ts b/falcor-router/falcor-router.d.ts new file mode 100644 index 0000000000..d4cfac8279 --- /dev/null +++ b/falcor-router/falcor-router.d.ts @@ -0,0 +1,59 @@ +// Type definitions for falcor-router 0.4.0 +// Project: https://github.com/Netflix/falcor-router +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +declare namespace FalcorRouter { + + import DataSource = FalcorModel.DataSource; + + class Router extends DataSource { + + constructor(routes: Array, options?: RouterOptions); + + /** + * When a route misses on a call, get, or set the unhandledDataSource will + * have a chance to fulfill that request. + **/ + routeUnhandledPathsTo(dataSource: DataSource): void; + + static createClass(routes?: Array): typeof CreatedRouter; + } + + class CreatedRouter extends Router { + constructor(options?: RouterOptions); + } + + interface Route { + route: string; + } + + type RoutePathSet = FalcorJsonGraph.PathSet; + + interface CallRoute extends Route { + call(callPath: RoutePathSet, args: Array): RouteResult | Promise; + } + + interface GetRoute extends Route { + get(pathset: RoutePathSet): RouteResult | Promise; + } + + interface SetRoute extends Route { + set(jsonGraph: FalcorJsonGraph.JSONGraph): RouteResult | Promise; + } + + type RouteDefinition = GetRoute | SetRoute | CallRoute; + type RouteResult = FalcorJsonGraph.PathValue | Array | FalcorJsonGraph.JSONEnvelope; + + interface RouterOptions { + debug?: boolean; + maxPaths?: number; + maxRefFollow?: number; + } +} + +declare module 'falcor-router' { + export = FalcorRouter.Router; +} + diff --git a/falcor/falcor-browser-tests.ts b/falcor/falcor-browser-tests.ts new file mode 100644 index 0000000000..2d1b618077 --- /dev/null +++ b/falcor/falcor-browser-tests.ts @@ -0,0 +1,18 @@ +/// + +var model = new falcor.Model({source: new falcor.HttpDataSource('/model.json')}); + +model.get('greeting').then(response => { + document.write(response.json.greeting); +}); + +model.set({ + json: { + someAtom: falcor.atom('value'), + someRef: falcor.ref('someAtom'), + someError: falcor.error('an error'), + } +}); + +model.set(falcor.pathValue('greeting', 'Hello, world')); + diff --git a/falcor/falcor-browser.d.ts b/falcor/falcor-browser.d.ts new file mode 100644 index 0000000000..6d05095d92 --- /dev/null +++ b/falcor/falcor-browser.d.ts @@ -0,0 +1,20 @@ +// Type definitions for falcor 0.1.17 +// Project: http://netflix.github.io/falcor/ +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare interface FalcorStatic { + Model: typeof FalcorModel.Model; + DataSource: typeof FalcorModel.DataSource; + HttpDataSource: typeof FalcorHttpDataSource.XMlHttpSource; + ref: typeof FalcorJsonGraph.ref; + atom: typeof FalcorJsonGraph.atom; + error: typeof FalcorJsonGraph.error; + pathValue: typeof FalcorJsonGraph.pathValue; +} + +declare var falcor: FalcorStatic; + diff --git a/falcor/falcor-tests.ts b/falcor/falcor-tests.ts new file mode 100644 index 0000000000..37b85fce68 --- /dev/null +++ b/falcor/falcor-tests.ts @@ -0,0 +1,132 @@ +/// + +import falcor = require('falcor'); + +let dataSource: falcor.DataSource; +dataSource.get([['someParam']]).subscribe(jsonGraphEnvelope => { + console.log(jsonGraphEnvelope.jsonGraph); +}); +dataSource.set({ + jsonGraph: { + someParam: 'value', + }, + paths: [['someParam']] +}).subscribe(jsonGraphEnvelope => { + console.log(jsonGraphEnvelope.jsonGraph); +}); + +dataSource.call(['items', 'push']); +dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}]); +dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']]); +dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']], [['length']]).subscribe(jsonGraphEnvelope => { + console.log(jsonGraphEnvelope.jsonGraph); + console.log(jsonGraphEnvelope.invalidate); + console.log(jsonGraphEnvelope.paths[0]); +}); + +new falcor.Model(); +new falcor.Model({}); +new falcor.Model({ + source: dataSource, + cache: {}, + maxSize: 100, + collectRatio: 0.5, + comparator: (a, b) => { + return a === b; + }, + errorSelector: (jsonGraphError: any) => { + console.error(jsonGraphError); + }, + onChange: () => { + console.log('Changed!'); + } +}); + +const model = new falcor.Model({ + cache: { + itemsById: { + i01: {id: 'i01', name: 'item 01'}, + i27: {id: 'i27', name: 'item 27'}, + }, + items: [ + {$type: 'ref', value: ['itemsById', 'i01']}, + {$type: 'ref', value: ['itemsById', 'i27']}, + ], + } +}); + +model.get('items[0].name'); +model.get(['items', 0, 'name']); +model.get(['items', {from: 0, to: 1}, 'name']); +model.get(['items', {from: 0, length: 2, hoge: 3}, 'name']); +model.get('items[0].name', 'items[1].name'); + +model.set({path: 'items[0].name', value: 'ITEM 01'}, {path: ['items', 1, 'name'], value: 'ITEM 27'}); +model.set({ + itemsById: { + i01: { + name: 'ITEM 01' + } + } +}); + +model.preload(); +model.preload(['items', 0, 'name']); +model.preload(['items', 0, 'name'], ['items', 1, 'name']); +model.preload(['items', {from: 0, to: 1}, 'name']); + +model.call('items.push'); +model.call(['items', 'push']); +model.call('items.push', [{id: 'i02', name: 'item02'}], ["length"]); +model.call('items.push', [{id: 'i02', name: 'item02'}], ["name", "length"], []); + +model.invalidate(); +model.invalidate(['items', 0, 'name']); +model.invalidate(['items', 0, 'name'], ['items', 1, 'name']); +model.invalidate(['items', {from: 0, to: 1}, 'name']); + +model.get('items[0].["name", "id"]').then(res => { + const derefedModel = model.deref(res.json.items[0]) + derefedModel.get('name', 'id'); +}); + +model.getValue('items[0].name').subscribe(); +model.getValue(['items', 0, 'name']).subscribe(); + +model.setValue('items[0].name', 'item001').subscribe(); +model.setValue(['items', 0, 'name'], 'item001').subscribe(); + +model.setCache({itemsById: {}}); + +const cache = model.getCache(); + +let version: number; +version = model.getVersion(); +version = model.getVersion(['items']); + +const delayedBatchingModel: falcor.Model = model.batch(100); +delayedBatchingModel.unbatch(); + +const teabModel: falcor.Model = model.treatErrorsAsValues(); + +const sourceFromModel: falcor.DataSource = model.asDataSource(); + +const boxingModel: falcor.Model = model.boxValues(); +const unboxingModel: falcor.Model = boxingModel.unboxValues(); +const noDataSourceModel: falcor.Model = model.withoutDataSource(); +const somePath: falcor.Path = model.getPath(); + +const modelResponse = model.get<{items: {length: number}}>('items.length'); + +modelResponse.subscribe(); +modelResponse.subscribe(res => res.json.items.length); +modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error)); +modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error), () => null); + +const subscription = modelResponse.subscribe(res => res); +subscription.dispose(); + +modelResponse.then(res => res.json.items.length); +modelResponse.then(res => res, error => console.error.bind(error)); +modelResponse.then(res => res.json.items.length).then((l: number) => l + 1); + diff --git a/falcor/falcor.d.ts b/falcor/falcor.d.ts new file mode 100644 index 0000000000..1d10a65529 --- /dev/null +++ b/falcor/falcor.d.ts @@ -0,0 +1,277 @@ +// Type definitions for falcor 0.1.17 +// Project: http://netflix.github.io/falcor/ +// Definitions by: Quramy +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace FalcorModel { + + ///////////////////////////////////////////////////// + // Global types + ///////////////////////////////////////////////////// + + export import Atom = FalcorJsonGraph.Atom; + export import Error = FalcorJsonGraph.Error; + export import Key = FalcorJsonGraph.Key; + export import KeySet = FalcorJsonGraph.KeySet; + export import Path = FalcorJsonGraph.Path; + export import PathSet = FalcorJsonGraph.PathSet; + export import PathValue = FalcorJsonGraph.PathValue; + export import JSONEnvelope = FalcorJsonGraph.JSONEnvelope; + export import JSONGraph = FalcorJsonGraph.JSONGraph; + export import JSONGraphEnvelope = FalcorJsonGraph.JSONGraphEnvelope; + export import Range = FalcorJsonGraph.Range; + export import Reference = FalcorJsonGraph.Reference; + + ///////////////////////////////////////////////////// + // DataSource + ///////////////////////////////////////////////////// + + /** + * A DataSource is an interface which can be implemented to expose JSON Graph information to a Model. Every DataSource is associated with a single JSON Graph object. Models execute JSON Graph operations (get, set, and call) to retrieve values from the DataSource’s JSON Graph object. DataSources may retrieve JSON Graph information from anywhere, including device memory, a remote machine, or even a lazily-run computation. + **/ + abstract class DataSource { + + /** + * The get method retrieves values from the DataSource's associated JSONGraph object. + **/ + get(pathSets: Array): Observable; + + + /** + * The set method accepts values to set in the DataSource's associated JSONGraph object. + **/ + set(jsonGraphEnvelope: JSONGraphEnvelope): Observable; + + + /** + * Invokes a function in the DataSource's JSONGraph object. + **/ + call(functionPath: Path, args?: Array, refSuffixes?: Array, thisPaths?: Array): Observable; + } + + + ///////////////////////////////////////////////////// + // Model + ///////////////////////////////////////////////////// + + interface ModelOptions { + source?: DataSource; + cache?: JSONGraph; + maxSize?: number; + collectRatio?: number; + errorSelector?: ModelErrorSelector; + onChange?: ModelOnChange; + comparator?: ModelComparator; + } + + /** + * This callback is invoked when the Model's cache is changed. + **/ + interface ModelOnChange { + (): void; + } + + /** + * This function is invoked on every JSONGraph Error retrieved from the DataSource. This function allows Error objects to be transformed before being stored in the Model's cache. + **/ + interface ModelErrorSelector { + (jsonGraphError: any): any; + } + + /** + * This function is invoked every time a value in the Model cache is about to be replaced with a new value. If the function returns true, the existing value is replaced with a new value and the version flag on all of the value's ancestors in the tree are incremented. + **/ + interface ModelComparator { + (existingValue: any, newValue: any): boolean; + } + + /** + * A Model object is used to execute commands against a {@link JSONGraph} object. {@link Model}s can work with a local JSONGraph cache, or it can work with a remote {@link JSONGraph} object through a {@link DataSource}. + **/ + class Model { + constructor(options?: ModelOptions); + + /** + * The get method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model}. The get method loads each value into a JSON object and returns in a ModelResponse. + **/ + get(...path: Array): ModelResponse>; + get(...path: Array): ModelResponse>; + + /** + * Sets the value at one or more places in the JSONGraph model. The set method accepts one or more {@link PathValue}s, each of which is a combination of a location in the document and the value to place there. In addition to accepting {@link PathValue}s, the set method also returns the values after the set operation is complete. + **/ + set(...args: Array): ModelResponse>; + set(...args: Array): ModelResponse>; + set(jsonGraph: JSONGraph): ModelResponse>; + set(jsonGraph: JSONGraph): ModelResponse>; + + /** + * The preload method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model} and loads them into the Model cache. + **/ + preload(...path: Array): void; + + /** + * Invokes a function in the JSON Graph. + **/ + // NOTE: In http://netflix.github.io/falcor/doc/Model.html#call, it says that refPaths should be an array. + // However, model implementation returns an error with setting refPaths as Array and it works with refPaths as PathSet. + // So refPaths is defined as a PathSet in this .d.ts. + call(functionPath: string | Path, args?: Array, refPaths?: PathSet, thisPaths?: Array): ModelResponse>; + call(functionPath: string | Path, args?: Array, refPaths?: PathSet, thisPaths?: Array): ModelResponse>; + + /** + * The invalidate method synchronously removes several {@link Path}s or {@link PathSet}s from a {@link Model} cache. + **/ + invalidate(...path: Array): void; + + /** + * Returns a new {@link Model} bound to a location within the {@link JSONGraph}. The bound location is never a {@link Reference}: any {@link Reference}s encountered while resolving the bound {@link Path} are always replaced with the {@link Reference}s target value. For subsequent operations on the {@link Model}, all paths will be evaluated relative to the bound path. Deref allows you to: + * - Expose only a fragment of the {@link JSONGraph} to components, rather than the entire graph + * - Hide the location of a {@link JSONGraph} fragment from components + * - Optimize for executing multiple operations and path looksup at/below the same location in the {@link JSONGraph} + **/ + deref(responseObject: any): Model; + + /** + * Get data for a single {@link Path}. + **/ + getValue(path: string | Path): ModelResponse; + getValue(path: string | Path): ModelResponse; + + /** + * Set value for a single {@link Path}. + **/ + setValue(path: string | Path, value: any): ModelResponse; + setValue(path: string | Path, value: any): ModelResponse; + + /** + * Set the local cache to a {@link JSONGraph} fragment. This method can be a useful way of mocking a remote document, or restoring the local cache from a previously stored state. + **/ + setCache(jsonGraph: JSONGraph): void; + + /** + * Get the local {@link JSONGraph} cache. This method can be a useful to store the state of the cache. + **/ + getCache(...path: Array): JSONGraph; + + /** + * Retrieves a number which is incremented every single time a value is changed underneath the Model or the object at an optionally-provided Path beneath the Model. + **/ + getVersion(path?: Path): number; + + /** + * Returns a clone of the {@link Model} that enables batching. Within the configured time period, paths for get operations are collected and sent to the {@link DataSource} in a batch. Batching can be more efficient if the {@link DataSource} access the network, potentially reducing the number of HTTP requests to the server. + **/ + batch(schedulerOrDelay?: number | Scheduler): Model; // FIXME what's a valid type for scheduler? + + /** + * Returns a clone of the {@link Model} that disables batching. This is the default mode. Each get operation will be executed on the {@link DataSource} separately. + **/ + unbatch(): Model; + + /** + * Returns a clone of the {@link Model} that treats errors as values. Errors will be reported in the same callback used to report data. Errors will appear as objects in responses, rather than being sent to the {@link Observable~onErrorCallback} callback of the {@link ModelResponse}. + **/ + treatErrorsAsValues(): Model; + + /** + * Adapts a Model to the {@link DataSource} interface. + **/ + asDataSource(): DataSource; + + /** + * Returns a clone of the {@link Model} that boxes values returning the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the value inside it. This allows any metadata attached to the wrapper to be inspected. + **/ + boxValues(): Model; + + /** + * Returns a clone of the {@link Model} that unboxes values, returning the value inside of the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the wrapper itself. This is the default mode. + **/ + unboxValues(): Model; + + /** + * Returns a clone of the {@link Model} that only uses the local {@link JSONGraph} and never uses a {@link DataSource} to retrieve missing paths. + **/ + withoutDataSource(): Model; + + /** + * Returns the {@link Path} to the object within the JSON Graph that this Model references. + **/ + getPath(): Path; + } + + + ///////////////////////////////////////////////////// + // ModelResponse + ///////////////////////////////////////////////////// + + class ModelResponse extends Observable{ + constructor(observable: Observable); + progressively(): ModelResponse>; + forEach(onNext: (value: T) => void, onError?: (error: Error) => void, onCompleted?: () => void): Subscription; + then(onFulfilled?: (value: T) => any | Thenable, onRejected?: (error: any) => void): Thenable; + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; + } + + interface Thenable { + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; + } + + + ///////////////////////////////////////////////////// + // Observable + ///////////////////////////////////////////////////// + + class Observable{ + + /** + * The forEach method is a synonym for {@link Observable.prototype.subscribe} and triggers the execution of the Observable, causing the values within to be pushed to a callback. An Observable is like a pipe of water that is closed. When forEach is called, we open the valve and the values within are pushed at us. These values can be received using either callbacks or an {@link Observer} object. + **/ + forEach(onNext?: ObservableOnNextCallback, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription; + + /** + * The subscribe method is a synonym for {@link Observable.prototype.forEach} and triggers the execution of the Observable, causing the values within to be pushed to a callback. An Observable is like a pipe of water that is closed. When forEach is called, we open the valve and the values within are pushed at us. These values can be received using either callbacks or an {@link Observer} object. + **/ + subscribe(onNext?: ObservableOnNextCallback, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription; + } + + /** + * This callback accepts a value that was emitted while evaluating the operation underlying the {@link Observable} stream. + **/ + interface ObservableOnNextCallback { + (value: T): void; + } + + /** + * This callback accepts an error that occurred while evaluating the operation underlying the {@link Observable} stream. When this callback is invoked, the {@link Observable} stream ends and no more values will be received by the {@link Observable~onNextCallback}. + **/ + interface ObservableOnErrorCallback { + (error: Error): void; + } + + /** + * This callback is invoked when the {@link Observable} stream ends. When this callback is invoked the {@link Observable} stream has ended, and therefore the {@link Observable~onNextCallback} will not receive any more values. + **/ + interface ObservableOnCompletedCallback { + (): void; + } + + class Subscription { + /** + * When this method is called on the Subscription, the Observable that created the Subscription will stop sending values to the callbacks passed when the Subscription was created. + **/ + dispose(): void; + } + + interface Scheduler { + catch(handler: (exception: any) => boolean): Scheduler; + catchException(handler: (exception: any) => boolean): Scheduler; + } +} + +declare module 'falcor' { + export = FalcorModel; +} diff --git a/fancybox/fancybox.d.ts b/fancybox/fancybox.d.ts index f130acb3d6..0a827baaa5 100644 --- a/fancybox/fancybox.d.ts +++ b/fancybox/fancybox.d.ts @@ -73,6 +73,8 @@ interface FancyboxOptions extends FancyboxCallback { prevMethod?: string; helpers?: any; + live?: boolean; + parent?: string; } interface FancyboxMethods { @@ -126,4 +128,4 @@ interface JQuery { interface JQueryStatic { fancybox: FancyboxMethods; -} \ No newline at end of file +} diff --git a/filesize/filesize-tests.ts b/filesize/filesize-tests.ts new file mode 100644 index 0000000000..185dfb0720 --- /dev/null +++ b/filesize/filesize-tests.ts @@ -0,0 +1,15 @@ +/// + +import filesize = require("filesize"); + +filesize(500); // "500 B" +filesize(500, { bits: true }); // "4 Kb" +filesize(265318, { base: 10 }); // "265.32 kB" +filesize(265318); // "259.1 KB" +filesize(265318, { round: 0 }); // "259 KB" +filesize(265318, { output: "array" }); // [259.1, "KB"] +filesize(265318, { output: "object" }); // {value: 259.1, suffix: "KB", symbol: "KB"} +filesize(1, { symbols: { B: "Б" } }); // "1 Б" +filesize(1024); // "1 KB" +filesize(1024, { exponent: 0 }); // "1024 B" +filesize(1024, { output: "exponent" }); // 1 diff --git a/filesize/filesize.d.ts b/filesize/filesize.d.ts new file mode 100644 index 0000000000..2ac4de6e05 --- /dev/null +++ b/filesize/filesize.d.ts @@ -0,0 +1,84 @@ +// Type definitions for filesize 3.2.1 +// Project: https://github.com/avoidwork/filesize.js +// Definitions by: Giedrius Grabauskas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Filesize { + + export interface SiJedecBits { + b?: string; + Kb?: string; + Mb?: string; + Gb?: string; + Tb?: string; + Pb?: string; + Eb?: string; + Zb?: string; + Yb?: string; + } + + export interface SiJedecBytes { + B?: string; + KB?: string; + MB?: string; + GB?: string; + TB?: string; + PB?: string; + EB?: string; + ZB?: string; + YB?: string; + } + + type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string }; + + export interface Options { + /** + * Enables bit sizes, default is false + */ + bits?: boolean; + /** + * Number base, default is 2 + */ + base?: number; + /** + * Decimal place, default is 2 + */ + round?: number; + /** + * Output of function (array, exponent, object, or string), default is string + */ + output?: string; + /** + * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found + * @deprecated: use 'symbols' + */ + suffixes?: SiJedec; + /** + * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found + */ + symbols?: SiJedec; + /** + * Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1 + */ + exponent?: number; + /** + * Enables unix style human readable output, e.g ls -lh, default is false + */ + unix?: boolean; + /** + * Character between the result and suffix, default is " " + */ + spacer?: string; + } + + export interface IFilesize { + (bytes: number): string; + (bytes: number, options: Options): string; + } +} + + +declare module "filesize" { + let fileSize: Filesize.IFilesize; + export = fileSize; +} diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index cceaaf506f..132973e916 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -334,6 +334,46 @@ interface FirebaseAuthData { expires: number; auth: Object; google?: FirebaseAuthDataGoogle; + twitter?: FirebaseAuthDataTwitter; + github?: FirebaseAuthDataGithub; + facebook?: FirebaseAuthDataFacebook; + password?: FirebaseAuthDataPassword; + anonymous?: any; +} + +interface FirebaseAuthDataPassword{ + email: string; + isTemporaryPassword: boolean; + profileImageURL: string; +} + +interface FirebaseAuthDataTwitter{ + id: string; + accessToken: string; + accessTokenSecret: string; + displayName: string; + username: string; + profileImageURL: string; + cachedUserProfile: any; +} + +interface FirebaseAuthDataGithub{ + id: string; + accessToken: string; + displayName: string; + email?: string; + username: string; + profileImageURL: string; + cachedUserProfile: any; +} + +interface FirebaseAuthDataFacebook{ + id: string; + accessToken: string; + displayName: string; + email?: string; + profileImageURL: string; + cachedUserProfile: any; } interface FirebaseAuthDataGoogle { diff --git a/flowjs/flowjs-tests.ts b/flowjs/flowjs-tests.ts index b89625b48f..b9e1e61b1c 100644 --- a/flowjs/flowjs-tests.ts +++ b/flowjs/flowjs-tests.ts @@ -71,8 +71,8 @@ flowFile.cancel(); flowFile.retry(); flowFile.bootstrap(); bool = flowFile.isUploading(); -bool = flowFile.isComplete; -num = flowFile.sizeUploaded; -num = flowFile.timeRemaining; -str = flowFile.getExtension; -str = flowFile.getType; +bool = flowFile.isComplete(); +num = flowFile.sizeUploaded(); +num = flowFile.timeRemaining(); +str = flowFile.getExtension(); +str = flowFile.getType(); diff --git a/flowjs/flowjs.d.ts b/flowjs/flowjs.d.ts index d9d14851e8..ff5c6b8b25 100644 --- a/flowjs/flowjs.d.ts +++ b/flowjs/flowjs.d.ts @@ -76,10 +76,10 @@ declare namespace flowjs { retry(): void; bootstrap(): void; isUploading(): boolean; - isComplete: boolean; - sizeUploaded: number; - timeRemaining: number; - getExtension: string; - getType: string; + isComplete(): boolean; + sizeUploaded(): number; + timeRemaining(): number; + getExtension(): string; + getType(): string; } } diff --git a/gapi/gapi.d.ts b/gapi/gapi.d.ts index 9e4e603bb2..6d7e18a12e 100644 --- a/gapi/gapi.d.ts +++ b/gapi/gapi.d.ts @@ -140,8 +140,9 @@ declare namespace gapi.client { * @param name The name of the API to load. * @param version The version of the API to load * @param callback the function that is called once the API interface is loaded + * @param url optional, the url of your app - if using Google's APIs, don't set it */ - export function load(name: string, version: string, callback: () => any): void; + export function load(name: string, version: string, callback: () => any, url?: string): void; /** * Creates a HTTP request for making RESTful requests. * An object encapsulating the various arguments for this method. diff --git a/google-closure-compiler/google-closure-compiler-tests.ts b/google-closure-compiler/google-closure-compiler-tests.ts new file mode 100644 index 0000000000..b87bb4948c --- /dev/null +++ b/google-closure-compiler/google-closure-compiler-tests.ts @@ -0,0 +1,28 @@ +/// + +import * as GoogleClosureCompiler from 'google-closure-compiler'; + +// See +// https://github.com/chadkillingsworth/closure-compiler-npm#plugin-authors-and-native-node-usage +// for the API example. This code tries to do the exact same thing. + +let ClosureCompiler = GoogleClosureCompiler.compiler; + +console.log(ClosureCompiler.COMPILER_PATH) +console.log(ClosureCompiler.CONTRIB_PATH) + +let options: GoogleClosureCompiler.CompileOptions = { + js: 'file-one.js', + compilation_level: 'ADVANCED', +}; +let closureCompiler = new ClosureCompiler(options); +let compilerProcess = closureCompiler.run((exitCode, stdout, stderr) => { + // ... +}); + +let jsonStream: GoogleClosureCompiler.JSONStreamFile[] = [ + { + path: 'foo.js', + src: 'var x = "hello, world";', + }, +]; diff --git a/google-closure-compiler/google-closure-compiler.d.ts b/google-closure-compiler/google-closure-compiler.d.ts new file mode 100644 index 0000000000..e1a21ab106 --- /dev/null +++ b/google-closure-compiler/google-closure-compiler.d.ts @@ -0,0 +1,38 @@ +// Type definitions for google-closure-compiler +// Project: https://github.com/chadkillingsworth/closure-compiler-npm +// Definitions by: Evan Martin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'google-closure-compiler' { + import * as child_process from 'child_process'; + + // The "json_streams" compiler flag lets the compiler accept/produce + // arrays of JSON objects in this shape for input/output. + interface JSONStreamFile { + path: string; + src: string; + srcmap?: string; // TODO(evan): pass through source maps. + } + + interface Compiler { + javaPath: string; + logger: (...args: any[]) => void; + spawnOptions: {[key:string]: string}; + + run(callback?: (exitCode: number, stdout: string, stderr: string) => void): + child_process.ChildProcess; + + getFullCommand(): string; + } + type CompileOptions = {[key: string]: string}; + var compiler: { + new (opts: (CompileOptions|string[]), + extraCommandArgs?: string[]): Compiler; + + JAR_PATH: string; + COMPILER_PATH: string; + CONTRIB_PATH: string; + }; +} diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index b77e665c28..4d225779ce 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -339,6 +339,7 @@ declare namespace google.maps { getCursor(): string; getDraggable(): boolean; getIcon(): string|Icon|Symbol; + getLabel(): MarkerLabel; getMap(): Map|StreetViewPanorama; getOpacity(): number; getPlace(): Place; @@ -353,6 +354,7 @@ declare namespace google.maps { setCursor(cursor: string): void; setDraggable(flag: boolean): void; setIcon(icon: string|Icon|Symbol): void; + setLabel(label: string|MarkerLabel): void; setMap(map: Map|StreetViewPanorama): void; setOpacity(opacity: number): void; setOptions(options: MarkerOptions): void; @@ -390,6 +392,12 @@ declare namespace google.maps { * @type {(string|Icon|Symbol)} */ icon?: string|Icon|Symbol; + /** + * Adds a label to the marker. The label can either be a string, or a MarkerLabel object. + * Only the first character of the string will be displayed. + * @type {(string|MarkerLabel)} + */ + label?: string|MarkerLabel; /** * Map on which to display Marker. * @type {(Map|StreetViewPanorama)} @@ -468,6 +476,19 @@ declare namespace google.maps { url?: string; } + export interface MarkerLabel { + /** The color of the label text. Default color is black. */ + color?: string; + /** The font family of the label text (equivalent to the CSS font-family property). */ + fontFamily?: string; + /** The font size of the label text (equivalent to the CSS font-size property). Default size is 14px. */ + fontSize?: string; + /** The font weight of the label text (equivalent to the CSS font-weight property). */ + fontWeight?: string; + /** The text to be displayed in the label. Only the first character of this string will be shown. */ + text?: string; + } + export interface MarkerShape { coords?: number[]; type?: string; diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index a72a23791a..80487c134c 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -11,7 +11,7 @@ declare module "hammerjs" { interface HammerStatic { - new( element:HTMLElement, options?:any ): HammerManager; + new( element:HTMLElement | SVGElement, options?:any ): HammerManager; defaults:HammerDefaults; diff --git a/handsontable/handsontable-tests.ts b/handsontable/handsontable-tests.ts new file mode 100644 index 0000000000..88cbe587af --- /dev/null +++ b/handsontable/handsontable-tests.ts @@ -0,0 +1,190 @@ +/// + +function test_HandsontableInit() { + var elem = document.createElement('div'); + var hot = new Handsontable(elem, { + allowEmpty: true, + allowInsertColumn: true, + allowInsertRow: true, + allowInvalid: true, + allowRemoveColumn: true, + allowRemoveRow: true, + autoColumnSize: true, + autoComplete: [], + autoRowSize: true, + autoWrapCol: true, + autoWrapRow: true, + cell: [], + cells: function() {}, + checkedTemplate: true, + className: [], + colHeaders: true, + columnHeaderHeight: 123, + columns: [], + columnSorting: {}, + colWidths: 123, + commentedCellClassName: 'foo', + comments: [], + contextMenu: true, + contextMenuCopyPaste: {}, + copyable: true, + copyColsLimit: 123, + copyPaste: true, + copyRowsLimit: 123, + correctFormat: true, + currentColClassName: 'foo', + currentRowClassName: 'foo', + customBorders: true, + data: [], + dataSchema: {}, + dateFormat: 'foo', + debug: true, + defaultDate: 'foo', + disableVisualSelection: true, + editor: true, + enterBeginsEditing: true, + enterMoves: {}, + fillHandle: true, + fixedColumnsLeft: 123, + fixedRowsTop: 123, + format: 'foo', + fragmentSelection: true, + height: 123, + invalidCellClassName: 'foo', + label: {}, + language: 'foo', + manualColumnFreeze: true, + manualColumnMove: true, + manualColumnResize: true, + manualRowMove: true, + manualRowResize: true, + maxCols: 123, + maxRows: 123, + mergeCells: true, + minCols: 123, + minRows: 123, + minSpareCols: 123, + minSpareRows: 123, + multiSelect: true, + noWordWrapClassName: 'foo', + observeChanges: true, + observeDOMVisibility: true, + outsideClickDeselects: true, + pasteMode: 'foo', + persistentState: true, + placeholder: 123, + placeholderCellClassName: 'foo', + preventOverflow: true, + readOnly: true, + readOnlyCellClassName: 'foo', + renderAllRows: true, + renderer: 'foo', + rowHeaders: true, + rowHeaderWidth: 123, + rowHeights: 123, + search: true, + selectOptions: [], + skipColumnOnPaste: true, + sortFunction: function() {}, + sortIndicator: true, + source: [], + startCols: 123, + startRows: 123, + stretchH: 'foo', + strict: true, + tableClassName: 'foo', + tabMoves: {}, + title: 'foo', + trimDropdown: true, + trimWhitespace: true, + type: 'foo', + uncheckedTemplate: true, + undo: true, + validator: function() {}, + viewportColumnRenderingOffset: 123, + viewportRowRenderingOffset: 123, + visibleRows: 123, + width: 1232, + wordWrap: true, + }); +} + +function test_HandsontableMethods() { + var elem = document.createElement('div'); + var hot = new Handsontable(elem, {}); + hot.addHook('foo', []); + hot.addHookOnce('foo', []); + hot.alter('foo', 123, 123, 'foo', true); + hot.clear(); + hot.colOffset(); + hot.colToProp(123); + hot.countCols(); + hot.countEmptyCols(true); + hot.countEmptyRows(true); + hot.countRenderedCols(); + hot.countRenderedRows(); + hot.countRows(); + hot.countSourceRows(); + hot.countVisibleCols(); + hot.countVisibleRows(); + hot.deselectCell(); + hot.destroy(); + hot.destroyEditor(true); + hot.getActiveEditor(); + hot.getCell(123, 123, true); + hot.getCellEditor(123, 123); + hot.getCellMeta(123, 123); + hot.getCellRenderer(123, 123); + hot.getCellValidator(123, 123); + hot.getColHeader(123); + hot.getColWidth(123); + hot.getCoords(elem.querySelector('td')); + hot.getCopyableData(123, 123); + hot.getCopyableText(123, 123, 123, 123); + hot.getData(123, 123, 123, 123); + hot.getDataAtCell(123, 123); + hot.getDataAtCol(123); + hot.getDataAtProp(123); + hot.getDataAtRow(123); + hot.getDataAtRowProp(123, 'foo'); + hot.getDataType(123, 123, 123, 123); + hot.getInstance(); + hot.getPlugin('foo'); + hot.getRowHeader(123); + hot.getRowHeight(123); + hot.getSchema(); + hot.getSelected(); + hot.getSelectedRange(); + hot.getSettings(); + hot.getSourceData(123, 123, 123, 123); + hot.getSourceDataAtCell(123, 123); + hot.getSourceDataAtCol(123); + hot.getSourceDataAtRow(123); + hot.getValue(); + hot.hasColHeaders(); + hot.hasHook('foo'); + hot.hasRowHeaders(); + hot.isEmptyCol(123); + hot.isEmptyRow(123); + hot.isListening(); + hot.listen(); + hot.loadData([]); + hot.populateFromArray(123, 123, [], 123, 123, 'foo', 'foo', 'foo', []); + hot.propToCol('foo'); + hot.removeCellMeta(123, 123, 'foo'); + hot.removeHook('foo', function() {}); + hot.render(); + hot.rowOffset(); + hot.runHooks('foo', 123, 'foo', true, {}, [], function() {}); + hot.selectCell(123, 123, 123, 123, true, true); + hot.selectCellByProp(123, 'foo', 123, 'foo', true); + hot.setCellMeta(123, 123, 'foo', 'foo'); + hot.setCellMetaObject(123, 123, {}); + hot.setDataAtCell(123, 123, 'foo', 'foo'); + hot.setDataAtRowProp(123, 'foo', 'foo', 'foo'); + hot.spliceCol(123, 123, 123, 'foo'); + hot.spliceRow(123, 123, 123, 'foo'); + hot.unlisten(); + hot.updateSettings({}, true); + hot.validateCells(function() {}); +} diff --git a/handsontable/handsontable.d.ts b/handsontable/handsontable.d.ts new file mode 100644 index 0000000000..1af41e0125 --- /dev/null +++ b/handsontable/handsontable.d.ts @@ -0,0 +1,194 @@ +// Type definitions for Handsontable 0.24.1 +// Project: https://handsontable.com/ +// Definitions by: Handsoncode sp. z o.o. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\ + +declare namespace ht { + interface Options { + allowEmpty?: boolean; + allowInsertColumn?: boolean; + allowInsertRow?: boolean; + allowInvalid?: boolean; + allowRemoveColumn?: boolean; + allowRemoveRow?: boolean; + autoColumnSize?: Object|boolean; + autoComplete?: any[]; + autoRowSize?: Object|boolean; + autoWrapCol?: boolean; + autoWrapRow?: boolean; + cell?: any[]; + cells?: Function; + checkedTemplate?: boolean|string; + className?: string|any[]; + colHeaders?: boolean|any[]|Function; + columnHeaderHeight?: number|any[]; + columns?: any[]; + columnSorting?: boolean|Object; + colWidths?: any[]|Function|number|string; + commentedCellClassName?: string; + comments?: boolean|any[]; + contextMenu?: boolean|any[]|Object; + contextMenuCopyPaste?: Object; + copyable?: boolean; + copyColsLimit?: number; + copyPaste?: boolean; + copyRowsLimit?: number; + correctFormat?: boolean; + currentColClassName?: string; + currentRowClassName?: string; + customBorders?: boolean|any[]; + data?: any[]|Function; + dataSchema?: Object; + dateFormat?: string; + debug?: boolean; + defaultDate?: string; + disableVisualSelection?: boolean|string|any[]; + editor?: string|Function|boolean; + enterBeginsEditing?: boolean; + enterMoves?: Object|Function; + fillHandle?: boolean|string|Object; + fixedColumnsLeft?: number; + fixedRowsTop?: number; + format?: string; + fragmentSelection?: boolean|string; + height?: number|Function; + invalidCellClassName?: string; + label?: Object; + language?: string; + manualColumnFreeze?: boolean; + manualColumnMove?: boolean|any[]; + manualColumnResize?: boolean|any[]; + manualRowMove?: boolean|any[]; + manualRowResize?: boolean|any[]; + maxCols?: number; + maxRows?: number; + mergeCells?: boolean|any[]; + minCols?: number; + minRows?: number; + minSpareCols?: number; + minSpareRows?: number; + multiSelect?: boolean; + noWordWrapClassName?: string; + observeChanges?: boolean; + observeDOMVisibility?: boolean; + outsideClickDeselects?: boolean; + pasteMode?: string; + persistentState?: boolean; + placeholder?: any; + placeholderCellClassName?: string; + preventOverflow?: string|boolean; + readOnly?: boolean; + readOnlyCellClassName?: string; + renderAllRows?: boolean; + renderer?: string|Function; + rowHeaders?: boolean|any[]|Function; + rowHeaderWidth?: number|any[]; + rowHeights?: any[]|Function|number|string; + search?: boolean; + selectOptions?: any[]; + skipColumnOnPaste?: boolean; + sortFunction?: Function; + sortIndicator?: boolean; + source?: any[]|Function; + startCols?: number; + startRows?: number; + stretchH?: string; + strict?: boolean; + tableClassName?: string|any[]; + tabMoves?: Object; + title?: string; + trimDropdown?: boolean; + trimWhitespace?: boolean; + type?: string; + uncheckedTemplate?: boolean|string; + undo?: boolean; + validator?: Function|RegExp; + viewportColumnRenderingOffset?: number|string; + viewportRowRenderingOffset?: number|string; + visibleRows?: number; + width?: number|Function; + wordWrap?: boolean; + isEmptyCol?: (col: number) => boolean; + isEmptyRow?: (row: number) => boolean; + } + interface Methods { + addHook(key: string, callback: Function|any[]): void; + addHookOnce(key: string, callback: Function|any[]): void; + alter(action: string, index: number, amount?: number, source?: string, keepEmptyRows?: boolean): void; + clear(): void; + colOffset(): number; + colToProp(col: number): string|number; + countCols(): number; + countEmptyCols(ending?: boolean): number; + countEmptyRows(ending?: boolean): number; + countRenderedCols(): number; + countRenderedRows(): number; + countRows(): number; + countSourceRows(): number; + countVisibleCols(): number; + countVisibleRows(): number; + deselectCell(): void; + destroy(): void; + destroyEditor(revertOriginal?: boolean): void; + getActiveEditor(): Object; + getCell(row: number, col: number, topmost?: boolean): Element; + getCellEditor(row: number, col: number): Object; + getCellMeta(row: number, col: number): Object; + getCellRenderer(row: number, col: number): Function; + getCellValidator(row: number, col: number): any; + getColHeader(col: number): any[]|string; + getColWidth(col: number): number; + getCoords(elem: Element): Object; + getCopyableData(row: number, column: number): string; + getCopyableText(startRow: number, startCol: number, endRow: number, endCol: number): string; + getData(r?: number, c?: number, r2?: number, c2?: number): any[]; + getDataAtCell(row: number, col: number): any; + getDataAtCol(col: number): any[]; + getDataAtProp(prop: string|number): any[]; + getDataAtRow(row: number): any[]; + getDataAtRowProp(row: number, prop: string): any; + getDataType(rowFrom: number, columnFrom: number, rowTo: number, columnTo: number): string; + getInstance(): any; + getPlugin(pluginName: string): any; + getRowHeader(row?: number): any[]|string; + getRowHeight(row: number): number; + getSchema(): Object; + getSelected(): any[]; + getSelectedRange(): any; + getSettings(): Object; + getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[]; + getSourceDataAtCell(row: number, column: number): any; + getSourceDataAtCol(column: number): any[]; + getSourceDataAtRow(row: number): any[]|Object; + getValue(): any; + hasColHeaders(): boolean; + hasHook(key: string): boolean; + hasRowHeaders(): boolean; + isEmptyCol(col: number): boolean; + isEmptyRow(row: number): boolean; + isListening(): boolean; + listen(): void; + loadData(data: any[]): void; + populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any; + propToCol(prop: string): number; + removeCellMeta(row: number, col: number, key: string): void; + removeHook(key: string, callback: Function): void; + render(): void; + rowOffset(): number; + runHooks(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any; + selectCell(row: number, col: number, endRow?: number, endCol?: number, scrollToCell?: boolean, changeListener?: boolean): boolean; + selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean; + setCellMeta(row: number, col: number, key: string, val: string): void; + setCellMetaObject(row: number, col: number, prop: Object): void; + setDataAtCell(row: number|any[], col: number, value: string, source?: string): void; + setDataAtRowProp(row: number|any[], prop: string, value: string, source?: string): void; + spliceCol(col: number, index: number, amount: number, elements?: any): void; + spliceRow(row: number, index: number, amount: number, elements?: any): void; + unlisten(): void; + updateSettings(settings: Object, init: boolean): void; + validateCells(callback: Function): void; + } +} +declare var Handsontable: { + new (element: Element, options: ht.Options): ht.Methods; +}; diff --git a/hapi/hapi-8.2.0.d.ts b/hapi/hapi-8.2.0.d.ts index f1db2660e4..d205ade2bc 100644 --- a/hapi/hapi-8.2.0.d.ts +++ b/hapi/hapi-8.2.0.d.ts @@ -234,10 +234,10 @@ declare module "hapi" { credentialData?: any ): IBoom; /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ - (result: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; + (result?: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. - * The data argument is only used for passing back authentication data and is ignored elsewhere. */ + * The data argument is only used for passing back authentication data and is ignored elsewhere. */ continue(credentialData?: any): void; /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ diff --git a/hapi/hapi-tests-8.2.0.ts b/hapi/hapi-tests-8.2.0.ts index 11ad81d2dd..c61504f0fc 100644 --- a/hapi/hapi-tests-8.2.0.ts +++ b/hapi/hapi-tests-8.2.0.ts @@ -22,10 +22,12 @@ plugin.register.attributes = { }; // optional options parameter -server.register({}, function (err) {}); +server.register({}, function (err) { +}); -// optional options.routes.vhost parameter -server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, 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; } @@ -84,15 +86,22 @@ 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: { - } - } + method: 'GET', + path: '/hello2', + handler: function (request: Hapi.Request, reply: Function) { + reply('hello world2'); + }, + config: { + validate: {} + } +}]); + +server.route([{ + method: 'GET', + path: '/hello3', + handler: function (request: Hapi.Request, reply: Function) { + reply().code(201); + } }]); // Start the server diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index 5e02f6b5a5..d45c03549a 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -22,17 +22,19 @@ plugin.register.attributes = { }; // optional options parameter -server.register({}, function (err) {}); +server.register({}, function (err) { +}); // optional callback function with and without options server.register({}).then((res: any) => { console.log(res); }); -server.register({}, { select: "api", routes: { prefix: "/prefix" } }).then((res: any) => { +server.register({}, {select: "api", routes: {prefix: "/prefix"}}).then((res: any) => { console.log(res); }); // optional options.routes.vhost parameter -server.register({}, { select: "api", routes: { prefix: "/prefix" } }, function (err) {}); +server.register({}, {select: "api", routes: {prefix: "/prefix"}}, function (err) { +}); //server.pack.register(plugin, (err: Object) => { // if (err) { throw err; } @@ -91,28 +93,29 @@ 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: { - } - } + method: 'GET', + path: '/hello2', + handler: function (request: Hapi.Request, reply: Function) { + reply('hello world2'); + }, + config: { + validate: {} + } }]); // Should be able to chain reply options server.route([{ - method: 'GET', - path: '/chained-notation', - handler: function(request: Hapi.Request, reply: Hapi.IReply) { - reply('chained-notation') - .bytes(16) - .code(200) - .type('text/plain') - .header('X-Custom', 'some-value'); - } + method: 'GET', + path: '/chained-notation', + handler: function (request: Hapi.Request, reply: Hapi.IReply) { + reply.state('cookie_key', 'cookie_value'); + reply('chained-notation') + .bytes(16) + .code(200) + .type('text/plain') + .unstate('cookie_to_remove') + .header('X-Custom', 'some-value'); + } }]); // Start the server @@ -120,48 +123,50 @@ server.start(); // server startup may now return a promise server.start() - .then(() => { - console.log('Started!'); - }); + .then(() => { + console.log('Started!'); + }); //inject a request into connection server.inject({ - method: 'GET', - url: '/hello' + method: 'GET', + url: '/hello' }).then(response => { - console.log(response.statusCode); + console.log(response.statusCode); }); //the same but this time using callback server.inject({ - method: 'GET', - url: '/hello' + method: 'GET', + url: '/hello' }, response => { - console.log(response.statusCode); + console.log(response.statusCode); }); //tests for server initialization server.initialize() - .then(() => { - console.log('Initialized!') - }); + .then(() => { + console.log('Initialized!') + }); //and the same but with callback server.initialize(err => { - if (err) { - console.log(err); - } + if (err) { + console.log(err); + } }); //server stopping may now return a promise server.stop() - .then(() => { - console.log('Stopped!'); - }); + .then(() => { + console.log('Stopped!'); + }); //decorate can take an optional options argument -server.decorate('hello', 'world', () => {}, { - apply: true +server.decorate('hello', 'world', () => { +}, { + apply: true }); -server.decorate('hello2', 'world2', () => {}); +server.decorate('hello2', 'world2', () => { +}); diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index bd226eb01e..874a73a6c3 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -9,897 +9,909 @@ /// declare module "hapi" { - import http = require("http"); - import stream = require("stream"); - import Events = require("events"); + import http = require("http"); + import stream = require("stream"); + import Events = require("events"); - interface IDictionary { - [key: string]: T; - } + interface IDictionary { + [key: string]: T; + } - interface IThenable { - then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IThenable; - then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IThenable; - } + interface IThenable { + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IThenable; + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IThenable; + } - interface IPromise extends IThenable { - then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IPromise; - then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IPromise; - catch(onRejected?: (error: any) => U | IThenable): IPromise; - } + interface IPromise extends IThenable { + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IPromise; + then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IPromise; + catch(onRejected?: (error: any) => U | IThenable): IPromise; + } + + export interface IHeaderOptions { + append?: boolean; + separator?: string; + override?: boolean; + duplicate?: boolean; + } /** Boom Module for errors. https://github.com/hapijs/boom - * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: */ - export interface IBoom extends Error { - /** if true, indicates this is a Boom object instance. */ - isBoom: boolean; - /** convenience bool indicating status code >= 500. */ - isServer: boolean; - /** the error message. */ - message: string; - /** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */ - output: { - /** the HTTP status code (typically 4xx or 5xx). */ - statusCode: number; - /** an object containing any HTTP headers where each key is a header name and value is the header content. */ - headers: IDictionary; - /** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */ - payload: { - /** the HTTP status code, derived from error.output.statusCode. */ - statusCode: number; - /** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ - error: string; - /** the error message derived from error.message. */ - message: string; - }; - }; - /** reformat()rebuilds error.output using the other object properties. */ - reformat(): void; + * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: */ + export interface IBoom extends Error { + /** if true, indicates this is a Boom object instance. */ + isBoom: boolean; + /** convenience bool indicating status code >= 500. */ + isServer: boolean; + /** the error message. */ + message: string; + /** the formatted response.Can be directly manipulated after object construction to return a custom error response.Allowed root keys: */ + output: { + /** the HTTP status code (typically 4xx or 5xx). */ + statusCode: number; + /** an object containing any HTTP headers where each key is a header name and value is the header content. */ + headers: IDictionary; + /** the formatted object used as the response payload (stringified).Can be directly manipulated but any changes will be lost if reformat() is called.Any content allowed and by default includes the following content: */ + payload: { + /** the HTTP status code, derived from error.output.statusCode. */ + statusCode: number; + /** the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ + error: string; + /** the error message derived from error.message. */ + message: string; + }; + }; + /** reformat()rebuilds error.output using the other object properties. */ + reformat(): void; - } + } - /** cache functionality via the "CatBox" module. */ - export interface ICatBoxCacheOptions { - /** a prototype function or catbox engine object. */ - engine: any; - /** an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. */ - name?: string; - /** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */ - shared?: boolean; - } + /** cache functionality via the "CatBox" module. */ + export interface ICatBoxCacheOptions { + /** a prototype function or catbox engine object. */ + engine: any; + /** an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. */ + name?: string; + /** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */ + shared?: boolean; + } - /** Any connections configuration server defaults can be included to override and customize the individual connection. */ - export interface IServerConnectionOptions extends IConnectionConfigurationServerDefaults { - /** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/ - host?: string; - /** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/ - address?: string; - /** - the TCP port the connection will listen to.Defaults to an ephemeral port (0) which uses an available port when the server is started (and assigned to server.info.port).If port is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts with '\.\pipe' as a Windows named pipe.*/ - port?: string | number; - /** - the full public URI without the path (e.g. 'http://example.com:8080').If present, used as the connection info.uri otherwise constructed from the connection settings.*/ - uri?: string; - /** - optional node.js HTTP (or HTTPS) http.Server object or any compatible object.If the listener needs to be manually started, set autoListen to false.If the listener uses TLS, set tls to true.*/ - listener?: any; - /** - indicates that the connection.listener will be started manually outside the framework.Cannot be specified with a port setting.Defaults to true.*/ - autoListen?: boolean; - /** caching headers configuration: */ - cache?: { - /** - an array of HTTP response status codes (e.g. 200) which are allowed to include a valid caching directive.Defaults to [200]. */ - statuses: number[]; - }; - /** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/ - labels?: string | string[]; - /** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */ - tls?: boolean | { key?: string; cert?: string; pfx?: string; } | Object; + /** Any connections configuration server defaults can be included to override and customize the individual connection. */ + export interface IServerConnectionOptions extends IConnectionConfigurationServerDefaults { + /** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/ + host?: string; + /** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/ + address?: string; + /** - the TCP port the connection will listen to.Defaults to an ephemeral port (0) which uses an available port when the server is started (and assigned to server.info.port).If port is a string containing a '/' character, it is used as a UNIX domain socket path and if it starts with '\.\pipe' as a Windows named pipe.*/ + port?: string | number; + /** - the full public URI without the path (e.g. 'http://example.com:8080').If present, used as the connection info.uri otherwise constructed from the connection settings.*/ + uri?: string; + /** - optional node.js HTTP (or HTTPS) http.Server object or any compatible object.If the listener needs to be manually started, set autoListen to false.If the listener uses TLS, set tls to true.*/ + listener?: any; + /** - indicates that the connection.listener will be started manually outside the framework.Cannot be specified with a port setting.Defaults to true.*/ + autoListen?: boolean; + /** caching headers configuration: */ + cache?: { + /** - an array of HTTP response status codes (e.g. 200) which are allowed to include a valid caching directive.Defaults to [200]. */ + statuses: number[]; + }; + /** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/ + labels?: string | string[]; + /** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */ + tls?: boolean | { key?: string; cert?: string; pfx?: string; } | Object; - } + } - export interface IConnectionConfigurationServerDefaults { - /** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */ - app?: any; - /** connection load limits configuration where: */ - load?: { - /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxHeapUsedBytes: number; - /** maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxRssBytes: number; - /** maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ - maxEventLoopDelay: number; - }; - /** plugin-specific configuration which can later be accessed via connection.settings.plugins. Provides a place to store and pass connection-specific plugin configuration. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between connection.settings.plugins which is used to store configuration values and connection.plugins which is meant for storing run-time state. */ - plugins?: any; - /** controls how incoming request URIs are matched against the routing table: */ - router?: { - /** determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. */ - isCaseSensitive: boolean; - /** removes trailing slashes on incoming paths. Defaults to false. */ - stripTrailingSlash: boolean; - }; - /** a route options object used to set the default configuration for every route. */ - routes?: IRouteAdditionalConfigurationOptions; - state?: IServerState; - } + export interface IConnectionConfigurationServerDefaults { + /** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */ + app?: any; + /** connection load limits configuration where: */ + load?: { + /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxHeapUsedBytes: number; + /** maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxRssBytes: number; + /** maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxEventLoopDelay: number; + }; + /** plugin-specific configuration which can later be accessed via connection.settings.plugins. Provides a place to store and pass connection-specific plugin configuration. plugins is an object where each key is a plugin name and the value is the configuration. Note the difference between connection.settings.plugins which is used to store configuration values and connection.plugins which is meant for storing run-time state. */ + plugins?: any; + /** controls how incoming request URIs are matched against the routing table: */ + router?: { + /** determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. */ + isCaseSensitive: boolean; + /** removes trailing slashes on incoming paths. Defaults to false. */ + stripTrailingSlash: boolean; + }; + /** a route options object used to set the default configuration for every route. */ + routes?: IRouteAdditionalConfigurationOptions; + state?: IServerState; + } - /** Note that the options object is deeply cloned and cannot contain any values that are unsafe to perform deep copy on.*/ - export interface IServerOptions { - /** application-specific configuration which can later be accessed via server.settings.app. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time state. Defaults to {}. */ - app?: any; + /** Note that the options object is deeply cloned and cannot contain any values that are unsafe to perform deep copy on.*/ + export interface IServerOptions { + /** application-specific configuration which can later be accessed via server.settings.app. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time state. Defaults to {}. */ + app?: any; /** sets up server-side caching. Every server includes a default cache for storing application state. By default, a simple memory-based cache is created which has limited capacity and capabilities. hapi uses catbox for its cache which includes support for common storage solutions (e.g. Redis, MongoDB, Memcached, and Riak). Caching is only utilized if methods and plugins explicitly store their state in the cache. The server cache configuration only defines the storage container itself. cache can be assigned: - a prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')). - a configuration object with the following options: - enginea prototype function or catbox engine object. - namean identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. - sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. - other options passed to the catbox strategy used. - an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ - cache?: string | ICatBoxCacheOptions | Array | any; - /** sets the default connections configuration which can be overridden by each connection where: */ - connections?: IConnectionConfigurationServerDefaults; - /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ - debug?: boolean | { - /** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */ - log: string[]; - /** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/ - request: string[]; - }; - /** file system related settings*/ - files?: { - /** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/ - etagsCacheMaxSize?: number; - }; - /** process load monitoring*/ - load?: { - /** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/ - sampleInterval?: number; - }; + a prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')). + a configuration object with the following options: + enginea prototype function or catbox engine object. + namean identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines the default cache. If every cache includes a name, a default memory cache is provisions as well. + sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. + other options passed to the catbox strategy used. + an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ + cache?: string | ICatBoxCacheOptions | Array | any; + /** sets the default connections configuration which can be overridden by each connection where: */ + connections?: IConnectionConfigurationServerDefaults; + /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ + debug?: boolean | { + /** - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. */ + log: string[]; + /** - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to display all errors, set the option to ['error']. To turn off all console debug messages set it to false. Defaults to uncaught errors thrown in external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error.*/ + request: string[]; + }; + /** file system related settings*/ + files?: { + /** sets the maximum number of file etag hash values stored in the etags cache. Defaults to 10000.*/ + etagsCacheMaxSize?: number; + }; + /** process load monitoring*/ + load?: { + /** the frequency of sampling in milliseconds. Defaults to 0 (no sampling).*/ + sampleInterval?: number; + }; - /** 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; - /** 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; - /** 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; + /** 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; + /** 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; + /** 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; - } + } - export interface IServerViewCompile { - (template: string, options: any): void; - (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean) => void) => void) => void): void; - } + export interface IServerViewCompile { + (template: string, options: any): void; + (template: string, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: boolean) => void) => void) => void): void; + } - export interface IServerViewsAdditionalOptions { - /** path - the root file path used to resolve and load the templates identified when calling reply.view().Defaults to current working directory.*/ - path?: string; + export interface IServerViewsAdditionalOptions { + /** path - the root file path used to resolve and load the templates identified when calling reply.view().Defaults to current working directory.*/ + path?: string; /**partialsPath - the root file path where partials are located.Partials are small segments of template code that can be nested and reused throughout other templates.Defaults to no partials support (empty path). - */ - partialsPath?: string; - /**helpersPath - the directory path where helpers are located.Helpers are functions used within templates to perform transformations and other data manipulations using the template context or other inputs.Each '.js' file in the helpers directory is loaded and the file name is used as the helper name.The files must export a single method with the signature function(context) and return a string.Sub - folders are not supported and are ignored.Defaults to no helpers support (empty path).Note that jade does not support loading helpers this way.*/ - helpersPath?: string; - /**relativeTo - a base path used as prefix for path and partialsPath.No default.*/ - relativeTo?: string; + */ + partialsPath?: string; + /**helpersPath - the directory path where helpers are located.Helpers are functions used within templates to perform transformations and other data manipulations using the template context or other inputs.Each '.js' file in the helpers directory is loaded and the file name is used as the helper name.The files must export a single method with the signature function(context) and return a string.Sub - folders are not supported and are ignored.Defaults to no helpers support (empty path).Note that jade does not support loading helpers this way.*/ + helpersPath?: string; + /**relativeTo - a base path used as prefix for path and partialsPath.No default.*/ + relativeTo?: string; - /**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/ - layout?: boolean | string; - /**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/ - layoutPath?: string; - /**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/ - layoutKeywork?: string; - /**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/ - encoding?: string; - /**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/ - isCached?: boolean; - /**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/ - allowAbsolutePaths?: boolean; - /**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/ - allowInsecureAccess?: boolean; - /**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/ - compileOptions?: any; - /**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/ - runtimeOptions?: any; - /**contentType - the content type of the engine results.Defaults to 'text/html'.*/ - contentType?: string; - /**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/ - compileMode?: string; - /**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/ - context?: any; - } + /**layout - if set to true or a layout filename, layout support is enabled.A layout is a single template file used as the parent template for other view templates in the same engine.If true, the layout template name must be 'layout.ext' where 'ext' is the engine's extension. Otherwise, the provided filename is suffixed with the engine's extension and loaded.Disable layout when using Jade as it will handle including any layout files independently.Defaults to false.*/ + layout?: boolean | string; + /**layoutPath - the root file path where layout templates are located (using the relativeTo prefix if present). Defaults to path.*/ + layoutPath?: string; + /**layoutKeyword - the key used by the template engine to denote where primary template content should go.Defaults to 'content'.*/ + layoutKeywork?: string; + /**encoding - the text encoding used by the templates when reading the files and outputting the result.Defaults to 'utf8'.*/ + encoding?: string; + /**isCached - if set to false, templates will not be cached (thus will be read from file on every use).Defaults to true.*/ + isCached?: boolean; + /**allowAbsolutePaths - if set to true, allows absolute template paths passed to reply.view().Defaults to false.*/ + allowAbsolutePaths?: boolean; + /**allowInsecureAccess - if set to true, allows template paths passed to reply.view() to contain '../'.Defaults to false.*/ + allowInsecureAccess?: boolean; + /**compileOptions - options object passed to the engine's compile function. Defaults to empty options {}.*/ + compileOptions?: any; + /**runtimeOptions - options object passed to the returned function from the compile operation.Defaults to empty options {}.*/ + runtimeOptions?: any; + /**contentType - the content type of the engine results.Defaults to 'text/html'.*/ + contentType?: string; + /**compileMode - specify whether the engine compile() method is 'sync' or 'async'.Defaults to 'sync'.*/ + compileMode?: string; + /**context - a global context used with all templates.The global context option can be either an object or a function that takes no arguments and returns a context object.When rendering views, the global context will be merged with any context object specified on the handler or using reply.view().When multiple context objects are used, values from the global context always have lowest precedence.*/ + context?: any; + } - export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions { + export interface IServerViewsEnginesOptions extends IServerViewsAdditionalOptions { /**- the npm module used for rendering the templates.The module object must contain: "module", the rendering function. The required function signature depends on the compileMode settings. - * If the compileMode is 'sync', the signature is compile(template, options), the return value is a function with signature function(context, options), and the method is allowed to throw errors.If the compileMode is 'async', the signature is compile(template, options, callback) where callback has the signature function(err, compiled) where compiled is a function with signature function(context, options, callback) and callback has the signature function(err, rendered).*/ - module: { - compile?(template: any, options: any): (context: any, options: any) => void; - compile?(template: any, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: any) => void) => void) => void): void; - }; - } + * If the compileMode is 'sync', the signature is compile(template, options), the return value is a function with signature function(context, options), and the method is allowed to throw errors.If the compileMode is 'async', the signature is compile(template, options, callback) where callback has the signature function(err, compiled) where compiled is a function with signature function(context, options, callback) and callback has the signature function(err, rendered).*/ + module: { + compile?(template: any, options: any): (context: any, options: any) => void; + compile?(template: any, options: any, callback: (err: any, compiled: (context: any, options: any, callback: (err: any, rendered: any) => void) => void) => void): void; + }; + } /**Initializes the server views manager - var Hapi = require('hapi'); - var server = new Hapi.Server(); + var Hapi = require('hapi'); + var server = new Hapi.Server(); - server.views({ + server.views({ engines: { html: require('handlebars'), jade: require('jade') }, path: '/static/templates' }); - When server.views() is called within a plugin, the views manager is only available to plugins methods. - */ - export interface IServerViewsConfiguration extends IServerViewsAdditionalOptions { - /** - required object where each key is a file extension (e.g. 'html', 'hbr'), mapped to the npm module used for rendering the templates.Alternatively, the extension can be mapped to an object with the following options:*/ - engines: IDictionary | IServerViewsEnginesOptions; - /** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/ - defaultExtension?: string; - } + When server.views() is called within a plugin, the views manager is only available to plugins methods. + */ + export interface IServerViewsConfiguration extends IServerViewsAdditionalOptions { + /** - required object where each key is a file extension (e.g. 'html', 'hbr'), mapped to the npm module used for rendering the templates.Alternatively, the extension can be mapped to an object with the following options:*/ + engines: IDictionary | IServerViewsEnginesOptions; + /** defines the default filename extension to append to template names when multiple engines are configured and not explicit extension is provided for a given template. No default value.*/ + defaultExtension?: string; + } /** Concludes the handler activity by setting a response and returning control over to the framework where: - erran optional error response. - resultan optional response payload. - Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. - FLOW CONTROL: - When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ - export interface IReply { - (err: Error, - result?: string | number | boolean | Buffer | stream.Stream | IPromise | T, - /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ - credentialData?: any - ): IBoom; - /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ - (result: string | number | boolean | Buffer | stream.Stream | IPromise | T): Response; + erran optional error response. + resultan optional response payload. + Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first. + FLOW CONTROL: + When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */ + export interface IReply { + (err: Error, + result?: string | number | boolean | Buffer | stream.Stream | IPromise | T, + /** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */ + credentialData?: any): IBoom; + /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ + (result: string | number | boolean | Buffer | stream.Stream | IPromise | T): Response; /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. - * The data argument is only used for passing back authentication data and is ignored elsewhere. */ - continue(credentialData?: any): void; + * The data argument is only used for passing back authentication data and is ignored elsewhere. */ + continue(credentialData?: any): void; - /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ - file( - /** the file path. */ - path: string, - /** optional settings: */ - options?: { - /** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ - filename?: string; - /** specifies whether to include the 'Content-Disposition' header with the response. Available values: - false - header is not included. This is the default value. - 'attachment' - 'inline'*/ - mode?: boolean | string; - /** if true, looks 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. */ - lookupCompressed: boolean; - }): void; + /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ + file(/** the file path. */ + path: string, + /** optional settings: */ + options?: { + /** - an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ + filename?: string; + /** specifies whether to include the 'Content-Disposition' header with the response. Available values: + false - header is not included. This is the default value. + 'attachment' + 'inline'*/ + mode?: boolean | string; + /** if true, looks 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. */ + lookupCompressed: boolean; + }): void; /** Concludes the handler activity by returning control over to the router with a templatized view response. - the response flow control rules apply. */ + the response flow control rules apply. */ + view(/** the template filename and path, relative to the templates path configured via the server views manager. */ + template: string, + /** optional object used by the template to render context-specific result. Defaults to no context {}. */ + context?: {}, + /** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */ + options?: any): Response; + /** Sets a header on the response */ + header(name: string, value: string, options?: IHeaderOptions): Response; - view( - /** the template filename and path, relative to the templates path configured via the server views manager. */ - template: string, - /** optional object used by the template to render context-specific result. Defaults to no context {}. */ - context?: {}, - /** optional object used to override the server's views manager configuration for this response. Cannot override isCached, partialsPath, or helpersPath which are only loaded at initialization. */ - options?: any): Response; /** Concludes the handler activity by returning control over to the router and informing the router that a response has already been sent back directly via request.raw.res and that no further response action is needed - The response flow control rules do not apply. */ - close(options?: { - /** if false, the router will not call request.raw.res.end()) to ensure the response was ended. Defaults to true. */ - end?: boolean; - }): void; + The response flow control rules do not apply. */ + close(options?: { + /** if false, the router will not call request.raw.res.end()) to ensure the response was ended. Defaults to true. */ + end?: boolean; + }): void; /** Proxies the request to an upstream endpoint. - the response flow control rules do not apply. */ + the response flow control rules do not apply. */ - proxy(/** an object including the same keys and restrictions defined by the route proxy handler options. */ - options: IProxyHandlerConfig): void; + proxy(/** an object including the same keys and restrictions defined by the route proxy handler options. */ + options: IProxyHandlerConfig): void; /** Redirects the client to the specified uri. Same as calling reply().redirect(uri). - he response flow control rules apply. */ - redirect(uri: string): ResponseRedirect; - } + he response flow control rules apply. */ + redirect(uri: string): ResponseRedirect; - export interface ISessionHandler { - (request: Request, reply: IReply): void; - } - export interface IRequestHandler { - (request: Request): T; - } + /** Replies with the specified response */ + response(result: any): Response; + + /** Sets a cookie on the response */ + state(name: string, value: string, options?: any): void; + + /** Clears a cookie on the response */ + unstate(name: string, options?: any): void; + } + + export interface ISessionHandler { + (request: Request, reply: IReply): void; + } + export interface IRequestHandler { + (request: Request): T; + } - export interface IFailAction { - (source: string, error: any, next: () => void): void - } - /** generates a reverse proxy handler */ - export interface IProxyHandlerConfig { - /** the upstream service host to proxy requests to. The same path on the client request will be used as the path on the host.*/ - host?: string; - /** the upstream service port. */ - port?: number; + export interface IFailAction { + (source: string, error: any, next: () => void): void + } + /** generates a reverse proxy handler */ + export interface IProxyHandlerConfig { + /** the upstream service host to proxy requests to. The same path on the client request will be used as the path on the host.*/ + host?: string; + /** the upstream service port. */ + port?: number; /** The protocol to use when making a request to the proxied host: - 'http' - 'https'*/ - protocol?: string; - /** an absolute URI used instead of the incoming host, port, protocol, path, and query. Cannot be used with host, port, protocol, or mapUri.*/ - uri?: string; - /** if true, forwards the headers sent from the client to the upstream service being proxied to, headers sent from the upstream service will also be forwarded to the client. Defaults to false.*/ - passThrough?: boolean; - /** localStatePassThrough - if false, any locally defined state is removed from incoming requests before being passed upstream. This is a security feature to prevent local state (e.g. authentication cookies) from leaking upstream to other servers along with the cookies intended for those servers. This value can be overridden on a per state basis via the server.state() passThrough option. Defaults to false.*/ - localStatePassThrough?: boolean; - /**acceptEncoding - if false, does not pass-through the 'Accept-Encoding' HTTP header which is useful when using an onResponse post-processing to avoid receiving an encoded response (e.g. gzipped). Can only be used together with passThrough. Defaults to true (passing header).*/ - acceptEncoding?: boolean; - /** rejectUnauthorized - sets the rejectUnauthorized property on the https agent making the request. This value is only used when the proxied server uses TLS/SSL. When set it will override the node.js rejectUnauthorized property. If false then ssl errors will be ignored. When true the server certificate is verified and an 500 response will be sent when verification fails. This shouldn't be used alongside the agent setting as the agent will be used instead. Defaults to the https agent default value of true.*/ - rejectUnauthorized?: boolean; - /**if true, sets the 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto' headers when making a request to the proxied upstream endpoint. Defaults to false.*/ - xforward?: boolean; - /** the maximum number of HTTP redirections allowed, to be followed automatically by the handler. Set to false or 0 to disable all redirections (the response will contain the redirection received from the upstream service). If redirections are enabled, no redirections (301, 302, 307, 308) will be passed along to the client, and reaching the maximum allowed redirections will return an error response. Defaults to false.*/ - redirects?: boolean | number; - /**number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes).*/ - timeout?: number; + 'http' + 'https'*/ + protocol?: string; + /** an absolute URI used instead of the incoming host, port, protocol, path, and query. Cannot be used with host, port, protocol, or mapUri.*/ + uri?: string; + /** if true, forwards the headers sent from the client to the upstream service being proxied to, headers sent from the upstream service will also be forwarded to the client. Defaults to false.*/ + passThrough?: boolean; + /** localStatePassThrough - if false, any locally defined state is removed from incoming requests before being passed upstream. This is a security feature to prevent local state (e.g. authentication cookies) from leaking upstream to other servers along with the cookies intended for those servers. This value can be overridden on a per state basis via the server.state() passThrough option. Defaults to false.*/ + localStatePassThrough?: boolean; + /**acceptEncoding - if false, does not pass-through the 'Accept-Encoding' HTTP header which is useful when using an onResponse post-processing to avoid receiving an encoded response (e.g. gzipped). Can only be used together with passThrough. Defaults to true (passing header).*/ + acceptEncoding?: boolean; + /** rejectUnauthorized - sets the rejectUnauthorized property on the https agent making the request. This value is only used when the proxied server uses TLS/SSL. When set it will override the node.js rejectUnauthorized property. If false then ssl errors will be ignored. When true the server certificate is verified and an 500 response will be sent when verification fails. This shouldn't be used alongside the agent setting as the agent will be used instead. Defaults to the https agent default value of true.*/ + rejectUnauthorized?: boolean; + /**if true, sets the 'X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto' headers when making a request to the proxied upstream endpoint. Defaults to false.*/ + xforward?: boolean; + /** the maximum number of HTTP redirections allowed, to be followed automatically by the handler. Set to false or 0 to disable all redirections (the response will contain the redirection received from the upstream service). If redirections are enabled, no redirections (301, 302, 307, 308) will be passed along to the client, and reaching the maximum allowed redirections will return an error response. Defaults to false.*/ + redirects?: boolean | number; + /**number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes).*/ + timeout?: number; /** a function used to map the request URI to the proxied URI. Cannot be used together with host, port, protocol, or uri. The function signature is function(request, callback) where: - request - is the incoming request object. - callback - is function(err, uri, headers) where: - err - internal error condition. - uri - the absolute proxy URI. - headers - optional object where each key is an HTTP request header and the value is the header content.*/ - mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void; - /** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/ - onResponse?: ( - err: any, - res: http.ServerResponse, - req: Request, - reply: IReply, - settings: IProxyHandlerConfig, - ttl: number - ) => void; - /** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/ - ttl?: number; - /** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */ - agent?: http.Agent; - /** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/ - maxSockets?: boolean | number; - } - /** TODO: fill in joi definition */ - export interface IJoi { + request - is the incoming request object. + callback - is function(err, uri, headers) where: + err - internal error condition. + uri - the absolute proxy URI. + headers - optional object where each key is an HTTP request header and the value is the header content.*/ + mapUri?: (request: Request, callback: (err: any, uri: string, headers?: { [key: string]: string }) => void) => void; + /** a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function(err, res, request, reply, settings, ttl) where: - err - internal or upstream error returned from attempting to contact the upstream proxy. - res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). - request - is the incoming request object. - reply - the reply interface function. - settings - the proxy handler configuration. - ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'.*/ + onResponse?: (err: any, + res: http.ServerResponse, + req: Request, + reply: IReply, + settings: IProxyHandlerConfig, + ttl: number) => void; + /** if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided).*/ + ttl?: number; + /** - a node http(s) agent to be used for connections to upstream server. see https://nodejs.org/api/http.html#http_class_http_agent */ + agent?: http.Agent; + /** sets the maximum number of sockets available per outgoing proxy host connection. false means use the wreck module default value (Infinity). Does not affect non-proxy outgoing client connections. Defaults to Infinity.*/ + maxSockets?: boolean | number; + } + /** TODO: fill in joi definition */ + export interface IJoi { - } - /** a validation function using the signature function(value, options, next) */ - export interface IValidationFunction { + } + /** a validation function using the signature function(value, options, next) */ + export interface IValidationFunction { - (/** the object containing the path parameters. */ - value: any, - /** the server validation options. */ - options: any, - /** the callback function called when validation is completed. */ - next: (err: any, value: any) => void): void; - } - /** a custom error handler function with the signature 'function(request, reply, source, error)` */ - export interface IRouteFailFunction { - /** a custom error handler function with the signature 'function(request, reply, source, error)` */ - ( - /** - the [request object]. */ - request: Request, - /** the continuation reply interface. */ - reply: IReply, - /** the source of the invalid field (e.g. 'path', 'query', 'payload'). */ - source: string, - /** the error object prepared for the client response (including the validation function error under error.data). */ - error: any): void; - } + (/** the object containing the path parameters. */ + value: any, + /** the server validation options. */ + options: any, + /** the callback function called when validation is completed. */ + next: (err: any, value: any) => void): void; + } + /** a custom error handler function with the signature 'function(request, reply, source, error)` */ + export interface IRouteFailFunction { + /** a custom error handler function with the signature 'function(request, reply, source, error)` */ + (/** - the [request object]. */ + request: Request, + /** the continuation reply interface. */ + reply: IReply, + /** the source of the invalid field (e.g. 'path', 'query', 'payload'). */ + source: string, + /** the error object prepared for the client response (including the validation function error under error.data). */ + error: any): void; + } - /** Each route can be customize to change the default behavior of the request lifecycle using the following options: */ - export interface IRouteAdditionalConfigurationOptions { - /** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */ - app?: any; + /** Each route can be customize to change the default behavior of the request lifecycle using the following options: */ + export interface IRouteAdditionalConfigurationOptions { + /** application specific configuration.Should not be used by plugins which should use plugins[name] instead. */ + app?: any; /** authentication configuration.Value can be: false to disable authentication if a default strategy is set. - a string with the name of an authentication strategy registered with server.auth.strategy(). - an object */ - auth?: boolean | string | - { - /** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values: - 'required'authentication is required. - 'optional'authentication is optional (must be valid if present). - 'try'same as 'optional' but allows for invalid authentication. */ - mode?: string; - /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ - strategies?: string | Array; - /** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values: - falseno payload authentication.This is the default value. - 'required'payload authentication required.This is the default value when the scheme sets options.payload to true. - 'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */ - payload?: string; - /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ - scope?: string | Array | boolean; - /** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values: - anythe authentication can be on behalf of a user or application.This is the default value. - userthe authentication must be on behalf of a user. - appthe authentication must be on behalf of an application. */ - entity?: string; - /** - * an object or array of objects specifying the route access rules. Each rule is evaluated against an incoming - * request and access is granted if at least one rule matches. Each rule object must include at least one of: - */ - access?: IRouteAdditionalConfigurationAuthAccess | IRouteAdditionalConfigurationAuthAccess[]; - }; - /** an object passed back to the provided handler (via this) when called. */ - bind?: any; - /** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */ - cache?: { + a string with the name of an authentication strategy registered with server.auth.strategy(). + an object */ + auth?: boolean | string | + { + /** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values: + 'required'authentication is required. + 'optional'authentication is optional (must be valid if present). + 'try'same as 'optional' but allows for invalid authentication. */ + mode?: string; + /** a string array of strategy names in order they should be attempted.If only one strategy is used, strategy can be used instead with the single string value.Defaults to the default authentication strategy which is available only when a single strategy is configured. */ + strategies?: string | Array; + /** if set, the payload (in requests other than 'GET' and 'HEAD') is authenticated after it is processed.Requires a strategy with payload authentication support (e.g.Hawk).Cannot be set to a value other than 'required' when the scheme sets the options.payload to true.Available values: + falseno payload authentication.This is the default value. + 'required'payload authentication required.This is the default value when the scheme sets options.payload to true. + 'optional'payload authentication performed only when the client includes payload authentication information (e.g.hash attribute in Hawk). */ + payload?: string; + /** the application scope required to access the route.Value can be a scope string or an array of scope strings.The authenticated credentials object scope property must contain at least one of the scopes defined to access the route.Set to false to remove scope requirements.Defaults to no scope required. */ + scope?: string | Array | boolean; + /** the required authenticated entity type.If set, must match the entity value of the authentication credentials.Available values: + anythe authentication can be on behalf of a user or application.This is the default value. + userthe authentication must be on behalf of a user. + appthe authentication must be on behalf of an application. */ + entity?: string; + /** + * an object or array of objects specifying the route access rules. Each rule is evaluated against an incoming + * request and access is granted if at least one rule matches. Each rule object must include at least one of: + */ + access?: IRouteAdditionalConfigurationAuthAccess | IRouteAdditionalConfigurationAuthAccess[]; + }; + /** an object passed back to the provided handler (via this) when called. */ + bind?: any; + /** if the route method is 'GET', the route can be configured to include caching directives in the response using the following options */ + cache?: { /** mines the privacy flag included in clientside caching using the 'Cache-Control' header.Values are: - fault'no privacy flag.This is the default setting. - 'public'mark the response as suitable for public caching. - 'private'mark the response as suitable only for private caching. */ - privacy: string; - /** relative expiration expressed in the number of milliseconds since the item was saved in the cache.Cannot be used together with expiresAt. */ - expiresIn: number; - /** time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire.Cannot be used together with expiresIn. */ - expiresAt: string; - }; - /** the Cross- Origin Resource Sharing protocol allows browsers to make cross- origin API calls.CORS is required by web applications running inside a browser which are loaded from a different domain than the API server.CORS headers are disabled by default. To enable, set cors to true, or to an object with the following options: */ - cors?: { - /** a strings array of allowed origin servers ('Access-Control-Allow-Origin').The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '' character, or a single `''origin string. Defaults to any origin['*']`. */ - origin?: Array; - /** if true, matches the value of the incoming 'Origin' header to the list of origin values ('*' matches anything) and if a match is found, uses that as the value of the 'Access-Control-Allow-Origin' response header.When false, the origin config is returned as- is.Defaults to true. */ - matchOrigin?: boolean; - /** if false, prevents the connection from returning the full list of non- wildcard origin values if the incoming origin header does not match any of the values.Has no impact if matchOrigin is set to false.Defaults to true. */ - isOriginExposed?: boolean; - /** number of seconds the browser should cache the CORS response ('Access-Control-Max-Age').The greater the value, the longer it will take before the browser checks for changes in policy.Defaults to 86400 (one day). */ - maxAge?: number; - /** a strings array of allowed headers ('Access-Control-Allow-Headers').Defaults to ['Authorization', 'Content-Type', 'If-None-Match']. */ - headers?: string[]; - /** a strings array of additional headers to headers.Use this to keep the default headers in place. */ - additionalHeaders?: string[]; - /** a strings array of allowed HTTP methods ('Access-Control-Allow-Methods').Defaults to ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS']. */ - methods?: string[]; - /** a strings array of additional methods to methods.Use this to keep the default methods in place. */ - additionalMethods?: string[]; - /** a strings array of exposed headers ('Access-Control-Expose-Headers').Defaults to ['WWW-Authenticate', 'Server-Authorization']. */ - exposedHeaders?: string[]; - /** a strings array of additional headers to exposedHeaders.Use this to keep the default headers in place. */ - additionalExposedHeaders?: string[]; - /** if true, allows user credentials to be sent ('Access-Control-Allow-Credentials').Defaults to false. */ - credentials?: boolean; - /** if false, preserves existing CORS headers set manually before the response is sent.Defaults to true. */ - override?: boolean; - }; - /** defines the behavior for serving static resources using the built-in route handlers for files and directories: */ - files?: {/** determines the folder relative paths are resolved against when using the file and directory handlers. */ - relativeTo: string; - }; + fault'no privacy flag.This is the default setting. + 'public'mark the response as suitable for public caching. + 'private'mark the response as suitable only for private caching. */ + privacy: string; + /** relative expiration expressed in the number of milliseconds since the item was saved in the cache.Cannot be used together with expiresAt. */ + expiresIn: number; + /** time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire.Cannot be used together with expiresIn. */ + expiresAt: string; + }; + /** the Cross- Origin Resource Sharing protocol allows browsers to make cross- origin API calls.CORS is required by web applications running inside a browser which are loaded from a different domain than the API server.CORS headers are disabled by default. To enable, set cors to true, or to an object with the following options: */ + cors?: { + /** a strings array of allowed origin servers ('Access-Control-Allow-Origin').The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '' character, or a single `''origin string. Defaults to any origin['*']`. */ + origin?: Array; + /** if true, matches the value of the incoming 'Origin' header to the list of origin values ('*' matches anything) and if a match is found, uses that as the value of the 'Access-Control-Allow-Origin' response header.When false, the origin config is returned as- is.Defaults to true. */ + matchOrigin?: boolean; + /** if false, prevents the connection from returning the full list of non- wildcard origin values if the incoming origin header does not match any of the values.Has no impact if matchOrigin is set to false.Defaults to true. */ + isOriginExposed?: boolean; + /** number of seconds the browser should cache the CORS response ('Access-Control-Max-Age').The greater the value, the longer it will take before the browser checks for changes in policy.Defaults to 86400 (one day). */ + maxAge?: number; + /** a strings array of allowed headers ('Access-Control-Allow-Headers').Defaults to ['Authorization', 'Content-Type', 'If-None-Match']. */ + headers?: string[]; + /** a strings array of additional headers to headers.Use this to keep the default headers in place. */ + additionalHeaders?: string[]; + /** a strings array of allowed HTTP methods ('Access-Control-Allow-Methods').Defaults to ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS']. */ + methods?: string[]; + /** a strings array of additional methods to methods.Use this to keep the default methods in place. */ + additionalMethods?: string[]; + /** a strings array of exposed headers ('Access-Control-Expose-Headers').Defaults to ['WWW-Authenticate', 'Server-Authorization']. */ + exposedHeaders?: string[]; + /** a strings array of additional headers to exposedHeaders.Use this to keep the default headers in place. */ + additionalExposedHeaders?: string[]; + /** if true, allows user credentials to be sent ('Access-Control-Allow-Credentials').Defaults to false. */ + credentials?: boolean; + /** if false, preserves existing CORS headers set manually before the response is sent.Defaults to true. */ + override?: boolean; + }; + /** defines the behavior for serving static resources using the built-in route handlers for files and directories: */ + files?: {/** determines the folder relative paths are resolved against when using the file and directory handlers. */ + relativeTo: string; + }; - /** an alternative location for the route handler option. */ - handler?: ISessionHandler | string | IRouteHandlerConfig; - /** an optional unique identifier used to look up the route using server.lookup(). */ - id?: number; - /** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */ - json?: { - /** the replacer function or array.Defaults to no action. */ - replacer?: Function | string[]; - /** number of spaces to indent nested object keys.Defaults to no indentation. */ - space?: number | string; - /** string suffix added after conversion to JSON string.Defaults to no suffix. */ - suffix?: string; - }; - /** enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload.For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'.Does not work with stream responses. */ - jsonp?: string; - /** determines how the request payload is processed: */ - payload?: { + /** an alternative location for the route handler option. */ + handler?: ISessionHandler | string | IRouteHandlerConfig; + /** an optional unique identifier used to look up the route using server.lookup(). */ + id?: number; + /** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */ + json?: { + /** the replacer function or array.Defaults to no action. */ + replacer?: Function | string[]; + /** number of spaces to indent nested object keys.Defaults to no indentation. */ + space?: number | string; + /** string suffix added after conversion to JSON string.Defaults to no suffix. */ + suffix?: string; + }; + /** enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload.For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'.Does not work with stream responses. */ + jsonp?: string; + /** determines how the request payload is processed: */ + payload?: { /** the type of payload representation requested. The value must be one of: - 'data'the incoming payload is read fully into memory.If parse is true, the payload is parsed (JSON, formdecoded, multipart) based on the 'Content- Type' header.If parse is false, the raw Buffer is returned.This is the default value except when a proxy handler is used. - 'stream'the incoming payload is made available via a Stream.Readable interface.If the payload is 'multipart/form-data' and parse is true, fields values are presented as text while files are provided as streams.File streams from a 'multipart/form-data' upload will also have a property hapi containing filename and headers properties. - 'file'the incoming payload in written to temporary file in the directory specified by the server's payload.uploads settings. If the payload is 'multipart/ formdata' and parse is true, fields values are presented as text while files are saved. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track of which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform any needed cleaup. */ - output?: string; + 'data'the incoming payload is read fully into memory.If parse is true, the payload is parsed (JSON, formdecoded, multipart) based on the 'Content- Type' header.If parse is false, the raw Buffer is returned.This is the default value except when a proxy handler is used. + 'stream'the incoming payload is made available via a Stream.Readable interface.If the payload is 'multipart/form-data' and parse is true, fields values are presented as text while files are provided as streams.File streams from a 'multipart/form-data' upload will also have a property hapi containing filename and headers properties. + 'file'the incoming payload in written to temporary file in the directory specified by the server's payload.uploads settings. If the payload is 'multipart/ formdata' and parse is true, fields values are presented as text while files are saved. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track of which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform any needed cleaup. */ + output?: string; /** can be true, false, or gunzip; determines if the incoming payload is processed or presented raw. true and gunzip includes gunzipping when the appropriate 'Content-Encoding' is specified on the received request. If parsing is enabled and the 'Content-Type' is known (for the whole payload as well as parts), the payload is converted into an object when possible. If the format is unknown, a Bad Request (400) error response is sent. Defaults to true, except when a proxy handler is used. The supported mime types are: - 'application/json' - 'application/x-www-form-urlencoded' - 'application/octet-stream' - 'text/ *' - 'multipart/form-data' */ - parse?: string | boolean; - /** a string or an array of strings with the allowed mime types for the endpoint.Defaults to any of the supported mime types listed above.Note that allowing other mime types not listed will not enable them to be parsed, and that if parsing mode is 'parse', the request will result in an error response. */ - allow?: string | string[]; - /** a mime type string overriding the 'Content-Type' header value received.Defaults to no override. */ - override?: string; - /** limits the size of incoming payloads to the specified byte count.Allowing very large payloads may cause the server to run out of memory.Defaults to 1048576 (1MB). */ - maxBytes?: number; - /** payload reception timeout in milliseconds.Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) error response.Set to false to disable.Defaults to 10000 (10 seconds). */ - timeout?: number; - /** the directory used for writing file uploads.Defaults to os.tmpDir(). */ - uploads?: string; + 'application/json' + 'application/x-www-form-urlencoded' + 'application/octet-stream' + 'text/ *' + 'multipart/form-data' */ + parse?: string | boolean; + /** a string or an array of strings with the allowed mime types for the endpoint.Defaults to any of the supported mime types listed above.Note that allowing other mime types not listed will not enable them to be parsed, and that if parsing mode is 'parse', the request will result in an error response. */ + allow?: string | string[]; + /** a mime type string overriding the 'Content-Type' header value received.Defaults to no override. */ + override?: string; + /** limits the size of incoming payloads to the specified byte count.Allowing very large payloads may cause the server to run out of memory.Defaults to 1048576 (1MB). */ + maxBytes?: number; + /** payload reception timeout in milliseconds.Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) error response.Set to false to disable.Defaults to 10000 (10 seconds). */ + timeout?: number; + /** the directory used for writing file uploads.Defaults to os.tmpDir(). */ + uploads?: string; /** determines how to handle payload parsing errors. Allowed values are: - 'error'return a Bad Request (400) error response. This is the default value. - 'log'report the error but continue processing the request. - 'ignore'take no action and continue processing the request. */ - failAction?: string; - }; - /** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */ - plugins?: IDictionary; - /** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */ - pre?: any[]; - /** validation rules for the outgoing response payload (response body).Can only validate object response: */ - response?: { - /** the default HTTP status code when the payload is empty. Value can be 200 or 204. - Note that a 200 status code is converted to a 204 only at the time or response transmission - (the response status code will remain 200 throughout the request lifecycle unless manually set). Defaults to 200. */ - emptyStatusCode?: number; + 'error'return a Bad Request (400) error response. This is the default value. + 'log'report the error but continue processing the request. + 'ignore'take no action and continue processing the request. */ + failAction?: string; + }; + /** pluginspecific configuration.plugins is an object where each key is a plugin name and the value is the plugin configuration. */ + plugins?: IDictionary; + /** an array with [route prerequisites] methods which are executed in serial or in parallel before the handler is called. */ + pre?: any[]; + /** validation rules for the outgoing response payload (response body).Can only validate object response: */ + response?: { + /** the default HTTP status code when the payload is empty. Value can be 200 or 204. + Note that a 200 status code is converted to a 204 only at the time or response transmission + (the response status code will remain 200 throughout the request lifecycle unless manually set). Defaults to 200. */ + emptyStatusCode?: number; /** the default response object validation rules (for all non-error responses) expressed as one of: - true - any payload allowed (no validation performed). This is the default. - false - no payload allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - value - the object containing the response object. - options - the server validation options. - next(err) - the callback function called when validation is completed. */ - schema?: boolean | any; - /** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */ - status?: { [statusCode: number] : boolean | any }; - /** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */ - sample?: number; + true - any payload allowed (no validation performed). This is the default. + false - no payload allowed. + a Joi validation object. + a validation function using the signature function(value, options, next) where: + value - the object containing the response object. + options - the server validation options. + next(err) - the callback function called when validation is completed. */ + schema?: boolean | any; + /** HTTP status- codespecific validation rules.The status key is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema.If a response status code is not present in the status object, the schema definition is used, expect for errors which are not validated by default. */ + status?: { [statusCode: number]: boolean | any }; + /** the percent of responses validated (0100).Set to 0 to disable all validation.Defaults to 100 (all responses). */ + sample?: number; /** defines what to do when a response fails validation.Options are: - errorreturn an Internal Server Error (500) error response.This is the default value. - loglog the error but send the response. */ - failAction?: string; - /** if true, applies the validation rule changes to the response.Defaults to false. */ - modify?: boolean; - /** 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; - }; - /** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */ - security?: boolean | { - /** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */ - hsts?: boolean | number | { - /** the max- age portion of the header, as a number.Default is 15768000. */ - maxAge?: number; - /** a boolean specifying whether to add the includeSubdomains flag to the header. */ - includeSubdomains?: boolean; - /** a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. */ - preload?: boolean; - }; - /** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */ - xframe?: { - /** either 'deny', 'sameorigin', or 'allow-from' */ - rule: string; - /** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */ - source: string; - }; - /** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */ - xss?: boolean; - /** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */ - noOpen?: boolean; - /** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */ - noSniff?: boolean; - }; - /** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */ - state?: { - /** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */ - parse: boolean; + errorreturn an Internal Server Error (500) error response.This is the default value. + loglog the error but send the response. */ + failAction?: string; + /** if true, applies the validation rule changes to the response.Defaults to false. */ + modify?: boolean; + /** 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; + }; + /** sets common security headers (disabled by default).To enable set security to true or to an object with the following options */ + security?: boolean | { + /** controls the 'Strict-Transport-Security' header.If set to true the header will be set to max- age=15768000, if specified as a number the maxAge parameter will be set to that number.Defaults to true.You may also specify an object with the following fields: */ + hsts?: boolean | number | { + /** the max- age portion of the header, as a number.Default is 15768000. */ + maxAge?: number; + /** a boolean specifying whether to add the includeSubdomains flag to the header. */ + includeSubdomains?: boolean; + /** a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. */ + preload?: boolean; + }; + /** controls the 'X-Frame-Options' header.When set to true the header will be set to DENY, you may also specify a string value of 'deny' or 'sameorigin'.To use the 'allow-from' rule, you must set this to an object with the following fields: */ + xframe?: { + /** either 'deny', 'sameorigin', or 'allow-from' */ + rule: string; + /** when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored.If rule is 'allow-from' but source is unset, the rule will be automatically changed to 'sameorigin'. */ + source: string; + }; + /** boolean that controls the 'X-XSS-PROTECTION' header for IE.Defaults to true which sets the header to equal '1; mode=block'.NOTE: This setting can create a security vulnerability in versions of IE below 8, as well as unpatched versions of IE8.See here and here for more information.If you actively support old versions of IE, it may be wise to explicitly set this flag to false. */ + xss?: boolean; + /** boolean controlling the 'X-Download-Options' header for IE, preventing downloads from executing in your context.Defaults to true setting the header to 'noopen'. */ + noOpen?: boolean; + /** boolean controlling the 'X-Content-Type-Options' header.Defaults to true setting the header to its only and default option, 'nosniff'. */ + noSniff?: boolean; + }; + /** HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265).state supports the following options: */ + state?: { + /** determines if incoming 'Cookie' headers are parsed and stored in the request.state object.Defaults to true. */ + parse: boolean; /** determines how to handle cookie parsing errors.Allowed values are: - 'error'return a Bad Request (400) error response.This is the default value. - 'log'report the error but continue processing the request. - 'ignore'take no action. */ - failAction: string; - }; - /** request input validation rules for various request components.When using a Joi validation object, the values of the other inputs (i.e.headers, query, params, payload, and auth) are made available under the validation context (accessible in rules as Joi.ref('$query.key')).Note that validation is performed in order(i.e.headers, params, query, payload) and if type casting is used (converting a string to number), the value of inputs not yet validated will reflect the raw, unvalidated and unmodified values.The validate object supports: */ - validate?: { + 'error'return a Bad Request (400) error response.This is the default value. + 'log'report the error but continue processing the request. + 'ignore'take no action. */ + failAction: string; + }; + /** request input validation rules for various request components.When using a Joi validation object, the values of the other inputs (i.e.headers, query, params, payload, and auth) are made available under the validation context (accessible in rules as Joi.ref('$query.key')).Note that validation is performed in order(i.e.headers, params, query, payload) and if type casting is used (converting a string to number), the value of inputs not yet validated will reflect the raw, unvalidated and unmodified values.The validate object supports: */ + validate?: { /** validation rules for incoming request headers.Values allowed: - * trueany headers allowed (no validation performed).This is the default. - falseno headers allowed (this will cause all valid HTTP requests to fail). - a Joi validation object. - a validation function using the signature function(value, options, next) where: - valuethe object containing the request headers. - optionsthe server validation options. - next(err, value)the callback function called when validation is completed. - */ - headers?: boolean | IJoi | IValidationFunction; + * trueany headers allowed (no validation performed).This is the default. + falseno headers allowed (this will cause all valid HTTP requests to fail). + a Joi validation object. + a validation function using the signature function(value, options, next) where: + valuethe object containing the request headers. + optionsthe server validation options. + next(err, value)the callback function called when validation is completed. + */ + 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: - trueany path parameters allowed (no validation performed).This is the default. - falseno path variables allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - 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; + trueany path parameters allowed (no validation performed).This is the default. + falseno path variables allowed. + a Joi validation object. + a validation function using the signature function(value, options, next) where: + 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; /** 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. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - 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; + trueany query parameters allowed (no validation performed).This is the default. + falseno query parameters allowed. + a Joi validation object. + a validation function using the signature function(value, options, next) where: + 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; /** validation rules for an incoming request payload (request body).Values allowed: - trueany payload allowed (no validation performed).This is the default. - falseno payload allowed. - a Joi validation object. - a validation function using the signature function(value, options, next) where: - 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; - /** an optional object with error fields copied into every validation error response. */ - errorFields?: any; + trueany payload allowed (no validation performed).This is the default. + falseno payload allowed. + a Joi validation object. + a validation function using the signature function(value, options, next) where: + 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; + /** an optional object with error fields copied into every validation error response. */ + 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. - 'ignore'take no action. - OR a custom error handler function with the signature 'function(request, reply, source, error)` where: - requestthe request object. - 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; - /** 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; - }; - /** define timeouts for processing durations: */ - timeout?: { - /** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */ - server: boolean | number; - /** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */ - socket: boolean | number; - }; + 'error'return a Bad Request (400) error response.This is the default value. + 'log'log the error but continue processing the request. + 'ignore'take no action. + OR a custom error handler function with the signature 'function(request, reply, source, error)` where: + requestthe request object. + 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; + /** 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; + }; + /** define timeouts for processing durations: */ + timeout?: { + /** response timeout in milliseconds.Sets the maximum time allowed for the server to respond to an incoming client request before giving up and responding with a Service Unavailable (503) error response.Disabled by default (false). */ + server: boolean | number; + /** by default, node sockets automatically timeout after 2 minutes.Use this option to override this behavior.Defaults to undefined which leaves the node default unchanged.Set to false to disable socket timeouts. */ + socket: boolean | number; + }; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route description used for generating documentation (string). - */ - description?: string; + *route description used for generating documentation (string). + */ + description?: string; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route notes used for generating documentation (string or array of strings). - */ - notes?: string | string[]; + *route notes used for generating documentation (string or array of strings). + */ + notes?: string | string[]; /** ONLY WHEN ADDING NEW ROUTES (not when setting defaults). - *route tags used for generating documentation (array of strings). - */ - tags?: string[] - } + *route tags used for generating documentation (array of strings). + */ + tags?: string[] + } /** - * specifying the route access rules. Each rule is evaluated against an incoming request and access is granted if at least one rule matches - */ - export interface IRouteAdditionalConfigurationAuthAccess { + * specifying the route access rules. Each rule is evaluated against an incoming request and access is granted if at least one rule matches + */ + export interface IRouteAdditionalConfigurationAuthAccess { /** - * the application scope required to access the route. Value can be a scope string or an array of scope strings. - * The authenticated credentials object scope property must contain at least one of the scopes defined to access the route. - * If a scope string begins with a + character, that scope is required. If a scope string begins with a ! character, - * that scope is forbidden. For example, the scope ['!a', '+b', 'c', 'd'] means the incoming request credentials' - * scope must not include 'a', must include 'b', and must include on of 'c' or 'd'. You may also access properties - * on the request object (query and params} to populate a dynamic scope by using {} characters around the property name, - * such as 'user-{params.id}'. Defaults to false (no scope requirements). - */ - scope?: string | Array | boolean; + * the application scope required to access the route. Value can be a scope string or an array of scope strings. + * The authenticated credentials object scope property must contain at least one of the scopes defined to access the route. + * If a scope string begins with a + character, that scope is required. If a scope string begins with a ! character, + * that scope is forbidden. For example, the scope ['!a', '+b', 'c', 'd'] means the incoming request credentials' + * scope must not include 'a', must include 'b', and must include on of 'c' or 'd'. You may also access properties + * on the request object (query and params} to populate a dynamic scope by using {} characters around the property name, + * such as 'user-{params.id}'. Defaults to false (no scope requirements). + */ + scope?: string | Array | boolean; /** the required authenticated entity type. If set, must match the entity value of the authentication credentials. Available values: - * any - the authentication can be on behalf of a user or application. This is the default value. - * user - the authentication must be on behalf of a user which is identified by the presence of a user attribute in the credentials object returned by the authentication strategy. - * app - the authentication must be on behalf of an application which is identified by the lack of presence of a user attribute in the credentials object returned by the authentication strategy. - */ - entity?: string; - } + * any - the authentication can be on behalf of a user or application. This is the default value. + * user - the authentication must be on behalf of a user which is identified by the presence of a user attribute in the credentials object returned by the authentication strategy. + * app - the authentication must be on behalf of an application which is identified by the lack of presence of a user attribute in the credentials object returned by the authentication strategy. + */ + entity?: string; + } /** server.realm http://hapijs.com/api#serverrealm - The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), - the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). - Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. - The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). - exports.register = function (server, options, next) { + The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), + the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). + Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. + The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). + exports.register = function (server, options, next) { console.log(server.realm.modifiers.route.prefix); return next(); }; - */ - export interface IServerRealm { - /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */ - modifiers: { - /** routes preferences: */ - route: { - /** - the route path prefix used by any calls to server.route() from the server. */ - prefix: string; - /** the route virtual host settings used by any calls to server.route() from the server. */ - vhost: string; - }; + */ + export interface IServerRealm { + /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method */ + modifiers: { + /** routes preferences: */ + route: { + /** - the route path prefix used by any calls to server.route() from the server. */ + prefix: string; + /** the route virtual host settings used by any calls to server.route() from the server. */ + vhost: string; + }; - }; - /** the active plugin name (empty string if at the server root). */ - plugin: string; - /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ - plugins: IDictionary; - /** settings overrides */ - settings: { - files: { - relativeTo: any; - }; - bind: any; - } - } + }; + /** the active plugin name (empty string if at the server root). */ + plugin: string; + /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ + plugins: IDictionary; + /** settings overrides */ + settings: { + files: { + relativeTo: any; + }; + bind: any; + } + } /** server.state(name, [options]) http://hapijs.com/api#serverstatename-options - HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/ - export interface IServerState { -/** - the cookie name string. */name: string; + HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/ + export interface IServerState { + /** - the cookie name string. */name: string; -/** - are the optional cookie settings: */options: { -/** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ttl: number; -/** - sets the 'Secure' flag.Defaults to false.*/isSecure: boolean; -/** - sets the 'HttpOnly' flag.Defaults to false.*/isHttpOnly: boolean -/** - the path scope.Defaults to null (no path).*/path: any; -/** - the domain scope.Defaults to null (no domain). */domain: any; + /** - are the optional cookie settings: */options: { + /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ttl: number; + /** - sets the 'Secure' flag.Defaults to false.*/isSecure: boolean; + /** - sets the 'HttpOnly' flag.Defaults to false.*/isHttpOnly: boolean + /** - the path scope.Defaults to null (no path).*/path: any; + /** - the domain scope.Defaults to null (no domain). */domain: any; /** if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value. The value can be a function with signature function(request, next) where: - request - the request object. - next - the continuation function using the function(err, value) signature.*/ - autoValue: (request: Request, next: (err: any, value: any) => void) => void; + request - the request object. + next - the continuation function using the function(err, value) signature.*/ + autoValue: (request: Request, next: (err: any, value: any) => void) => void; /** - encoding performs on the provided value before serialization. Options are: - 'none' - no encoding. When used, the cookie value must be a string. This is the default value. - 'base64' - string value is encoded using Base64. - 'base64json' - object value is JSON-stringified than encoded using Base64. - 'form' - object value is encoded using the x-www-form-urlencoded method. - 'iron' - Encrypts and sign the value using iron.*/ - encoding: string; -/** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: { -/** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any; -/** - password used for HMAC key generation.*/password: string; - }; -/** - password used for 'iron' encoding.*/password: string; -/** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any; -/** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean; -/** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean; -/** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean; -/** - overrides the default proxy localStatePassThrough setting.*/passThrough: any; - }; - } + 'none' - no encoding. When used, the cookie value must be a string. This is the default value. + 'base64' - string value is encoded using Base64. + 'base64json' - object value is JSON-stringified than encoded using Base64. + 'form' - object value is encoded using the x-www-form-urlencoded method. + 'iron' - Encrypts and sign the value using iron.*/ + encoding: string; + /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: { + /** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any; + /** - password used for HMAC key generation.*/password: string; + }; + /** - password used for 'iron' encoding.*/password: string; + /** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any; + /** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean; + /** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean; + /** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean; + /** - overrides the default proxy localStatePassThrough setting.*/passThrough: any; + }; + } - export interface IFileHandlerConfig { - /** a path string or function as described above.*/ - path: string; - /** an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ - filename?: string; + export interface IFileHandlerConfig { + /** a path string or function as described above.*/ + path: string; + /** an optional filename to specify if sending a 'Content-Disposition' header, defaults to the basename of path*/ + filename?: string; /**- specifies whether to include the 'Content-Disposition' header with the response. Available values: - false - header is not included. This is the default value. - 'attachment' - 'inline'*/ - mode?: boolean | string; - /** if true, looks 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.*/ - lookupCompressed: boolean; - } + false - header is not included. This is the default value. + 'attachment' + 'inline'*/ + mode?: boolean | string; + /** if true, looks 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.*/ + lookupCompressed: boolean; + } /**http://hapijs.com/api#route-handler - Built-in handlers + Built-in handlers - The framework comes with a few built-in handler types available by setting the route handler config to an object containing one of these keys.*/ - export interface IRouteHandlerConfig { + The framework comes with a few built-in handler types available by setting the route handler config to an object containing one of these keys.*/ + export interface IRouteHandlerConfig { /** generates a static file endpoint for serving a single file. file can be set to: - 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 | IFileHandlerConfig; + 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 | 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. - an array of path strings. Each path will be attempted in order until a match is found (by following the same process as the single path string). - a function with the signature function(request) which returns the path string or an array of path strings. If the function returns an error, the error is passed back to the client in the response. - index - optional boolean|string|string[], determines if an index file will be served if found in the folder when requesting a directory. The given string or strings specify the name(s) of the index file to look for. If true, looks for 'index.html'. Any falsy value disables index file lookup. Defaults to true. - listing - optional boolean, determines if directory listing is generated when a directory is requested without an index document. Defaults to false. - showHidden - optional boolean, determines if hidden files will be shown and served. Defaults to false. - 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?: { - path: string | Array | IRequestHandler | IRequestHandler>; - index?: boolean | string | string[]; - listing?: boolean; - showHidden?: boolean; - redirectToSlash?: boolean; - lookupCompressed?: boolean; - defaultExtension?: string; - }; - proxy?: IProxyHandlerConfig; - view?: string | { - template: string; - context: { - payload: any; - params: any; - query: any; - pre: any; - } - }; - config?: { - handler: any; - bind: any; - app: any; - plugins: { - [name: string]: any; - }; - pre: Array<() => void>; - validate: { - headers: any; - params: any; - query: any; - payload: any; - errorFields?: any; - failAction?: string | IFailAction; - }; - payload: { - output: { - data: any; - stream: any; - file: any; - }; - parse?: any; - allow?: string | Array; - override?: string; - maxBytes?: number; - uploads?: number; - failAction?: string; - }; - response: { - schema: any; - sample: number; - failAction: string; - }; - cache: { - privacy: string; - expiresIn: number; - expiresAt: number; - }; - auth: string | boolean | { - mode: string; - strategies: Array; - payload?: boolean | string; - tos?: boolean | string; - scope?: string | Array; - entity: string; - }; - cors?: boolean; - jsonp?: string; - description?: string; - notes?: string | Array; - tags?: Array; - }; - } + 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. + an array of path strings. Each path will be attempted in order until a match is found (by following the same process as the single path string). + a function with the signature function(request) which returns the path string or an array of path strings. If the function returns an error, the error is passed back to the client in the response. + index - optional boolean|string|string[], determines if an index file will be served if found in the folder when requesting a directory. The given string or strings specify the name(s) of the index file to look for. If true, looks for 'index.html'. Any falsy value disables index file lookup. Defaults to true. + listing - optional boolean, determines if directory listing is generated when a directory is requested without an index document. Defaults to false. + showHidden - optional boolean, determines if hidden files will be shown and served. Defaults to false. + 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?: { + path: string | Array | IRequestHandler | IRequestHandler>; + index?: boolean | string | string[]; + listing?: boolean; + showHidden?: boolean; + redirectToSlash?: boolean; + lookupCompressed?: boolean; + defaultExtension?: string; + }; + proxy?: IProxyHandlerConfig; + view?: string | { + template: string; + context: { + payload: any; + params: any; + query: any; + pre: any; + } + }; + config?: { + handler: any; + bind: any; + app: any; + plugins: { + [name: string]: any; + }; + pre: Array<() => void>; + validate: { + headers: any; + params: any; + query: any; + payload: any; + errorFields?: any; + failAction?: string | IFailAction; + }; + payload: { + output: { + data: any; + stream: any; + file: any; + }; + parse?: any; + allow?: string | Array; + override?: string; + maxBytes?: number; + uploads?: number; + failAction?: string; + }; + response: { + schema: any; + sample: number; + failAction: string; + }; + cache: { + privacy: string; + expiresIn: number; + expiresAt: number; + }; + auth: string | boolean | { + mode: string; + strategies: Array; + payload?: boolean | string; + tos?: boolean | string; + scope?: string | Array; + entity: string; + }; + cors?: boolean; + jsonp?: string; + description?: string; + notes?: string | Array; + tags?: Array; + }; + } /** Route configuration - The route configuration object*/ - export interface IRouteConfiguration { - /** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/ - path: string; + The route configuration object*/ + export interface IRouteConfiguration { + /** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/ + path: string; /** - (required) the HTTP method.Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'.Any HTTP method is allowed, except for 'HEAD'.Use '*' to match against any HTTP method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match). - * Can be assigned an array of methods which has the same result as adding the same route with different methods manually.*/ - method: string | string[]; - /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ - vhost?: string; - /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ - handler: ISessionHandler | string | IRouteHandlerConfig; - /** - additional route options.*/ - config?: IRouteAdditionalConfigurationOptions; - } - /** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */ - export interface IRoute { + * Can be assigned an array of methods which has the same result as adding the same route with different methods manually.*/ + method: string | string[]; + /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ + vhost?: string; + /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ + handler: ISessionHandler | string | IRouteHandlerConfig; + /** - additional route options.*/ + config?: IRouteAdditionalConfigurationOptions; + } + /** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */ + export interface IRoute { - /** the route HTTP method. */ - method: string; - /** the route path. */ - path: string; - /** the route vhost option if configured. */ - vhost?: string | Array; - /** the [active realm] associated with the route.*/ - realm: IServerRealm; - /** the [route options] object with all defaults applied. */ - settings: IRouteAdditionalConfigurationOptions; - } + /** the route HTTP method. */ + method: string; + /** the route path. */ + path: string; + /** the route vhost option if configured. */ + vhost?: string | Array; + /** the [active realm] associated with the route.*/ + realm: IServerRealm; + /** the [route options] object with all defaults applied. */ + settings: IRouteAdditionalConfigurationOptions; + } - export interface IServerAuthScheme { + export interface IServerAuthScheme { /** authenticate(request, reply) - required function called on each incoming request configured with the authentication scheme where: - request - the request object. - reply - the reply interface the authentication method must call when done authenticating the request where: - reply(err, response, result) - is called if authentication failed where: - err - any authentication error. - response - any authentication response action such as redirection. Ignored if err is present, otherwise required. - result - an object containing: - credentials - the authenticated credentials. - artifacts - optional authentication artifacts. - reply.continue(result) - is called if authentication succeeded where: - result - same object as result above. - When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. - .If the err returned by the reply() method includes a message, no additional strategies will be attempted. - If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var scheme = function (server, options) { + request - the request object. + reply - the reply interface the authentication method must call when done authenticating the request where: + reply(err, response, result) - is called if authentication failed where: + err - any authentication error. + response - any authentication response action such as redirection. Ignored if err is present, otherwise required. + result - an object containing: + credentials - the authenticated credentials. + artifacts - optional authentication artifacts. + reply.continue(result) - is called if authentication succeeded where: + result - same object as result above. + When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. + .If the err returned by the reply() method includes a message, no additional strategies will be attempted. + If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + var scheme = function (server, options) { return { authenticate: function (request, reply) { var req = request.raw.req; @@ -911,185 +923,185 @@ declare module "hapi" { } }; }; - server.auth.scheme('custom', scheme);*/ - authenticate(request: Request, reply: IReply): void; + server.auth.scheme('custom', scheme);*/ + authenticate(request: Request, reply: IReply): void; /** payload(request, reply) - optional function called to authenticate the request payload where: - request - the request object. - reply(err, response) - is called if authentication failed where: - err - any authentication error. - response - any authentication response action such as redirection. Ignored if err is present, otherwise required. - reply.continue() - is called if payload authentication succeeded. - When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ - payload?(request: Request, reply: IReply): void; + request - the request object. + reply(err, response) - is called if authentication failed where: + err - any authentication error. + response - any authentication response action such as redirection. Ignored if err is present, otherwise required. + reply.continue() - is called if payload authentication succeeded. + When the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'.*/ + payload?(request: Request, reply: IReply): void; /** response(request, reply) - optional function called to decorate the response with authentication headers before the response headers or payload is written where: - request - the request object. - reply(err, response) - is called if an error occurred where: - err - any authentication error. - response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required. - reply.continue() - is called if the operation succeeded.*/ - response?(request: Request, reply: IReply): void; - /** an optional object */ - options?: { - /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ - payload: boolean; - } - } + request - the request object. + reply(err, response) - is called if an error occurred where: + err - any authentication error. + response - any authentication response to send instead of the current response. Ignored if err is present, otherwise required. + reply.continue() - is called if the operation succeeded.*/ + response?(request: Request, reply: IReply): void; + /** an optional object */ + options?: { + /** if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false.*/ + payload: boolean; + } + } - /**the response object where: - statusCode - the HTTP status code. - headers - an object containing the headers set. - payload - the response payload string. - rawPayload - the raw response payload buffer. - raw - an object with the injection request and response objects: - req - the simulated node request object. - res - the simulated node response object. - result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string). - request - the request object.*/ - export interface IServerInjectResponse { - statusCode: number; - headers: IDictionary; - payload: string; - rawPayload: Buffer; - raw: { - req: http.ClientRequest; - res: http.ServerResponse - }; - result: string; - request: Request; - } + /**the response object where: + statusCode - the HTTP status code. + headers - an object containing the headers set. + payload - the response payload string. + rawPayload - the raw response payload buffer. + raw - an object with the injection request and response objects: + req - the simulated node request object. + res - the simulated node response object. + result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the internal objects returned (instead of parsing the response string). + request - the request object.*/ + export interface IServerInjectResponse { + statusCode: number; + headers: IDictionary; + payload: string; + rawPayload: Buffer; + raw: { + req: http.ClientRequest; + res: http.ServerResponse + }; + result: string; + request: Request; + } - export interface IServerInject { - (options: string | IServerInjectOptions, callback: (res: IServerInjectResponse) => void): void; - (options: string | IServerInjectOptions): IPromise; - } + export interface IServerInject { + (options: string | IServerInjectOptions, callback: (res: IServerInjectResponse) => void): void; + (options: string | IServerInjectOptions): IPromise; + } - export interface IServerInjectOptions { - /** the request HTTP method (e.g. 'POST'). Defaults to 'GET'.*/ - method: string; - /** the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers.*/ - url: string; - /** an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default Shot headers.*/ - headers?: IDictionary; - /** n optional string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/ - payload?: string | {} | Buffer; - /** an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/ - credentials?: any; - /** an optional artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts.*/ - artifacts?: any; - /** sets the initial value of request.app*/ - app?: any; - /** sets the initial value of request.plugins*/ - plugins?: any; - /** allows access to routes with config.isInternal set to true. Defaults to false.*/ - allowInternals?: boolean; - /** sets the remote address for the incoming connection.*/ - remoteAddress?: boolean; - /**object with options used to simulate client request stream conditions for testing: - error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. - close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. - end - if false, does not end the stream. Defaults to true.*/ - simulate?: { - error: boolean; - close: boolean; - end: boolean; - }; - } + export interface IServerInjectOptions { + /** the request HTTP method (e.g. 'POST'). Defaults to 'GET'.*/ + method: string; + /** the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers.*/ + url: string; + /** an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default Shot headers.*/ + headers?: IDictionary; + /** n optional string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/ + payload?: string | {} | Buffer; + /** an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/ + credentials?: any; + /** an optional artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts.*/ + artifacts?: any; + /** sets the initial value of request.app*/ + app?: any; + /** sets the initial value of request.plugins*/ + plugins?: any; + /** allows access to routes with config.isInternal set to true. Defaults to false.*/ + allowInternals?: boolean; + /** sets the remote address for the incoming connection.*/ + remoteAddress?: boolean; + /**object with options used to simulate client request stream conditions for testing: + error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. + close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. + end - if false, does not end the stream. Defaults to true.*/ + simulate?: { + error: boolean; + close: boolean; + end: boolean; + }; + } /** host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. - The return value is an array where each item is an object containing: - info - the connection.info the connection the table was generated for. - labels - the connection labels. - table - an array of routes where each route contains: - settings - the route config with defaults applied. - method - the HTTP method in lower case. - path - the route path.*/ - export interface IConnectionTable { - info: any; - labels: any; - table: IRoute[]; - } + The return value is an array where each item is an object containing: + info - the connection.info the connection the table was generated for. + labels - the connection labels. + table - an array of routes where each route contains: + settings - the route config with defaults applied. + method - the HTTP method in lower case. + path - the route path.*/ + export interface IConnectionTable { + info: any; + labels: any; + table: IRoute[]; + } - export interface ICookieSettings { - /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ - ttl?: number; - /** - sets the 'Secure' flag.Defaults to false.*/ - isSecure?: boolean; - /** - sets the 'HttpOnly' flag.Defaults to false.*/ - isHttpOnly?: boolean; - /** - the path scope.Defaults to null (no path).*/ - path?: string; - /** - the domain scope.Defaults to null (no domain).*/ - domain?: any; + export interface ICookieSettings { + /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ + ttl?: number; + /** - sets the 'Secure' flag.Defaults to false.*/ + isSecure?: boolean; + /** - sets the 'HttpOnly' flag.Defaults to false.*/ + isHttpOnly?: boolean; + /** - the path scope.Defaults to null (no path).*/ + path?: string; + /** - the domain scope.Defaults to null (no domain).*/ + domain?: any; /** - if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value.The value can be a function with signature function(request, next) where: - request - the request object. - next - the continuation function using the function(err, value) signature.*/ - autoValue?: (request: Request, next: (err: any, value: any) => void) => void; + request - the request object. + next - the continuation function using the function(err, value) signature.*/ + autoValue?: (request: Request, next: (err: any, value: any) => void) => void; /** - encoding performs on the provided value before serialization.Options are: - 'none' - no encoding.When used, the cookie value must be a string.This is the default value. - 'base64' - string value is encoded using Base64. - 'base64json' - object value is JSON- stringified than encoded using Base64. - 'form' - object value is encoded using the x- www - form - urlencoded method. */ - encoding?: string; + 'none' - no encoding.When used, the cookie value must be a string.This is the default value. + 'base64' - string value is encoded using Base64. + 'base64json' - object value is JSON- stringified than encoded using Base64. + 'form' - object value is encoded using the x- www - form - urlencoded method. */ + encoding?: string; /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are: - integrity - algorithm options.Defaults to require('iron').defaults.integrity. - password - password used for HMAC key generation. */ - sign?: { integrity: any; password: string; } - password?: string; - iron?: any; - ignoreErrors?: boolean; - clearInvalid?: boolean; - strictHeader?: boolean; - passThrough?: any; - } + integrity - algorithm options.Defaults to require('iron').defaults.integrity. + password - password used for HMAC key generation. */ + sign?: { integrity: any; password: string; } + password?: string; + iron?: any; + ignoreErrors?: boolean; + clearInvalid?: boolean; + strictHeader?: boolean; + passThrough?: any; + } /** method - the method function with the signature is one of: - function(arg1, arg2, ..., argn, next) where: - arg1, arg2, etc. - the method function arguments. - next - the function called when the method is done with the signature function(err, result, ttl) where: - err - error response if the method failed. - result - the return value. - ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. - function(arg1, arg2, ..., argn) where: - arg1, arg2, etc. - the method function arguments. - the callback option is set to false. - the method must returns a value (result, Error, or a promise) or throw an Error.*/ - export interface IServerMethod { - //(): void; - //(next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any): void; - //(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void; - //(arg1: any, arg2: any): void; - (...args: any[]): void; + function(arg1, arg2, ..., argn, next) where: + arg1, arg2, etc. - the method function arguments. + next - the function called when the method is done with the signature function(err, result, ttl) where: + err - error response if the method failed. + result - the return value. + ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. + function(arg1, arg2, ..., argn) where: + arg1, arg2, etc. - the method function arguments. + the callback option is set to false. + the method must returns a value (result, Error, or a promise) or throw an Error.*/ + export interface IServerMethod { + //(): void; + //(next: (err: any, result: any, ttl: number) => void): void; + //(arg1: any): void; + //(arg1: any, arg2: any, next: (err: any, result: any, ttl: number) => void): void; + //(arg1: any, arg2: any): void; + (...args: any[]): void; - } + } /** options - optional configuration: - bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. - cache - the same cache configuration used in server.cache(). - callback - if false, expects the method to be a synchronous function. Note that using a synchronous function with caching will convert the method interface to require a callback as an additional argument with the signature function(err, result, cached, report) since the cache interface cannot return values synchronously. Defaults to true. - generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the callback argument is not passed as input). The server will automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated).*/ - export interface IServerMethodOptions { - bind?: any; - cache?: ICatBoxCacheOptions; - callback?: boolean; - generateKey?(args: any[]): string; - } + bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. + cache - the same cache configuration used in server.cache(). + callback - if false, expects the method to be a synchronous function. Note that using a synchronous function with caching will convert the method interface to require a callback as an additional argument with the signature function(err, result, cached, report) since the cache interface cannot return values synchronously. Defaults to true. + generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the callback argument is not passed as input). The server will automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated).*/ + export interface IServerMethodOptions { + bind?: any; + cache?: ICatBoxCacheOptions; + callback?: boolean; + generateKey?(args: any[]): string; + } /** Request object - The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle. - Request events + The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle. + Request events - The request object supports the following events: + The request object supports the following events: - 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). - 'finish' - emitted when the request payload finished reading. The event method signature is function (). - 'disconnect' - emitted when a request errors or aborts unexpectedly. - var Crypto = require('crypto'); - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + 'finish' - emitted when the request payload finished reading. The event method signature is function (). + 'disconnect' - emitted when a request errors or aborts unexpectedly. + var Crypto = require('crypto'); + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - server.ext('onRequest', function (request, reply) { + server.ext('onRequest', function (request, reply) { var hash = Crypto.createHash('sha1'); request.on('peek', function (chunk) { @@ -1109,222 +1121,224 @@ declare module "hapi" { return reply.continue(); });*/ - export class Request extends Events.EventEmitter { - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** authentication information*/ - auth: { - /** true is the request has been successfully authenticated, otherwise false.*/ - isAuthenticated: boolean; - /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. can be set in the validate function's callback.*/ - credentials: any; - /** an artifact object received from the authentication strategy and used in authentication-related actions.*/ - artifacts: any; - /** the route authentication mode.*/ - mode: any; - /** the authentication error is failed and mode set to 'try'.*/ - error: any; - }; - /** the connection used by this request*/ - connection: ServerConnection; - /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/ - domain: any; - /** the raw request headers (references request.raw.headers).*/ - headers: IDictionary; - /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/ - id: number; - /** request information */ - info: { - /** the request preferred encoding. */ - acceptEncoding: string; - /** if CORS is enabled for the route, contains the following: */ - cors: { - isOriginMatch: boolean; /** true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only available after the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. */ - }; - /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ - host: string; - /** the hostname part of the 'Host' header (e.g. 'example.com').*/ - hostname: string; - /** request reception timestamp. */ - received: number; - /** content of the HTTP 'Referrer' (or 'Referer') header. */ - referrer: string; - /** remote client IP address. */ - remoteAddress: string; - /** remote client port. */ - remotePort: number; - /** request response timestamp (0 is not responded yet). */ - responded: number; - }; - /** the request method in lower case (e.g. 'get', 'post'). */ - method: string; - /** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */ - mime: string; - /** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/ - orig: { - params: any; - query: any; - payload: any; - }; - /** an object where each key is a path parameter name with matching value as described in Path parameters.*/ - params: IDictionary; - /** an array containing all the path params values in the order they appeared in the path.*/ - paramsArray: string[]; - /** the request URI's path component. */ - path: string; - /** the request payload based on the route payload.output and payload.parse settings.*/ - payload: stream.Readable | Buffer | any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/ - plugins: any; - /** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/ - pre: IDictionary; - /** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/ - response: Response; - /**preResponses - same as pre but represented as the response object created by the pre method.*/ - preResponses: any; - /**an object containing the query parameters.*/ - query: any; - /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ - raw: { - req: http.ClientRequest; - res: http.ServerResponse; - }; - /** the route public interface.*/ - route: IRoute; - /** the server object. */ - server: Server; - /** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */ - state: any; - /** complex object contining details on the url */ - url: { - /** null when i tested */ - auth: any; - /** null when i tested */ - hash: any; - /** null when i tested */ - host: any; - /** null when i tested */ - hostname: any; - href: string; - path: string; - /** path without search*/ - pathname: string; - /** null when i tested */ - port: any; - /** null when i tested */ - protocol: any; - /** querystring parameters*/ - query: IDictionary; - /** querystring parameters as a string*/ - search: string; - /** null when i tested */ - slashes: any; - }; + export class Request extends Events.EventEmitter { + /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ + app: any; + /** authentication information*/ + auth: { + /** true is the request has been successfully authenticated, otherwise false.*/ + isAuthenticated: boolean; + /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. can be set in the validate function's callback.*/ + credentials: any; + /** an artifact object received from the authentication strategy and used in authentication-related actions.*/ + artifacts: any; + /** the route authentication mode.*/ + mode: any; + /** the authentication error is failed and mode set to 'try'.*/ + error: any; + }; + /** the connection used by this request*/ + connection: ServerConnection; + /** the node domain object used to protect against exceptions thrown in extensions, handlers and route prerequisites. Can be used to manually bind callback functions otherwise bound to other domains.*/ + domain: any; + /** the raw request headers (references request.raw.headers).*/ + headers: IDictionary; + /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}').*/ + id: number; + /** request information */ + info: { + /** the request preferred encoding. */ + acceptEncoding: string; + /** if CORS is enabled for the route, contains the following: */ + cors: { + isOriginMatch: boolean; /** true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only available after the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. */ + }; + /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ + host: string; + /** the hostname part of the 'Host' header (e.g. 'example.com').*/ + hostname: string; + /** request reception timestamp. */ + received: number; + /** content of the HTTP 'Referrer' (or 'Referer') header. */ + referrer: string; + /** remote client IP address. */ + remoteAddress: string; + /** remote client port. */ + remotePort: number; + /** request response timestamp (0 is not responded yet). */ + responded: number; + }; + /** the request method in lower case (e.g. 'get', 'post'). */ + method: string; + /** the parsed content-type header. Only available when payload parsing enabled and no payload error occurred. */ + mime: string; + /** an object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed.*/ + orig: { + params: any; + query: any; + payload: any; + }; + /** an object where each key is a path parameter name with matching value as described in Path parameters.*/ + params: IDictionary; + /** an array containing all the path params values in the order they appeared in the path.*/ + paramsArray: string[]; + /** the request URI's path component. */ + path: string; + /** the request payload based on the route payload.output and payload.parse settings.*/ + payload: stream.Readable | Buffer | any; + /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state.*/ + plugins: any; + /** an object where each key is the name assigned by a route prerequisites function. The values are the raw values provided to the continuation function as argument. For the wrapped response object, use responses.*/ + pre: IDictionary; + /** the response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects).*/ + response: Response; + /**preResponses - same as pre but represented as the response object created by the pre method.*/ + preResponses: any; + /**an object containing the query parameters.*/ + query: any; + /** an object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended.*/ + raw: { + req: http.ClientRequest; + res: http.ServerResponse; + }; + /** the route public interface.*/ + route: IRoute; + /** the server object. */ + server: Server; + /** an object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. */ + state: any; + /** complex object contining details on the url */ + url: { + /** null when i tested */ + auth: any; + /** null when i tested */ + hash: any; + /** null when i tested */ + host: any; + /** null when i tested */ + hostname: any; + href: string; + path: string; + /** path without search*/ + pathname: string; + /** null when i tested */ + port: any; + /** null when i tested */ + protocol: any; + /** querystring parameters*/ + query: IDictionary; + /** querystring parameters as a string*/ + search: string; + /** null when i tested */ + slashes: any; + }; + /** request.setUrl(url) - Available only in 'onRequest' extension methods. + Available only in 'onRequest' extension methods. - Changes the request URI before the router begins processing the request where: + Changes the request URI before the router begins processing the request where: - url - the new request path value. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + url - the new request path value. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - server.ext('onRequest', function (request, reply) { + server.ext('onRequest', function (request, reply) { // Change all requests to '/test' request.setUrl('/test'); return reply.continue(); });*/ - setUrl(url: string): void; + setUrl(url: string): void; + /** request.setMethod(method) - Available only in 'onRequest' extension methods. + Available only in 'onRequest' extension methods. - Changes the request method before the router begins processing the request where: + Changes the request method before the router begins processing the request where: - method - is the request HTTP method (e.g. 'GET'). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + method - is the request HTTP method (e.g. 'GET'). + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - server.ext('onRequest', function (request, reply) { + server.ext('onRequest', function (request, reply) { // Change all requests to 'GET' request.setMethod('GET'); return reply.continue(); });*/ - setMethod(method: string): void; + setMethod(method: string): void; + /** request.log(tags, [data, [timestamp]]) - Always available. + Always available. - Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are: + Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are: - data - an optional message string or object with the application data being logged. - timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). - Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true. + data - an optional message string or object with the application data being logged. + timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). + Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - server.on('request', function (request, event, tags) { + server.on('request', function (request, event, tags) { if (tags.error) { console.log(event); } }); - var handler = function (request, reply) { + var handler = function (request, reply) { request.log(['test', 'error'], 'Test event'); return reply(); }; - */ - log( - /** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ - tags: string | string[], - /** an optional message string or object with the application data being logged.*/ - data?: string, - /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ - timestamp?: number): void; + */ + log(/** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ + tags: string | string[], + /** an optional message string or object with the application data being logged.*/ + data?: string, + /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ + timestamp?: number): void; + /** request.getLog([tags], [internal]) - Always available. + Always available. - Returns an array containing the events matching any of the tags specified (logical OR) - request.getLog(); - request.getLog('error'); - request.getLog(['error', 'auth']); - request.getLog(['error'], true); - request.getLog(false);*/ + Returns an array containing the events matching any of the tags specified (logical OR) + request.getLog(); + request.getLog('error'); + request.getLog(['error', 'auth']); + request.getLog(['error'], true); + request.getLog(false);*/ - getLog( - /** is a single tag string or array of tag strings. If no tags specified, returns all events.*/ - tags?: string, - /** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/ - internal?: boolean): string[]; + getLog(/** is a single tag string or array of tag strings. If no tags specified, returns all events.*/ + tags?: string, + /** filters the events to only those with a matching event.internal value. If true, only internal logs are included. If false, only user event are included. Defaults to all events (undefined).*/ + internal?: boolean): string[]; /** request.tail([name]) - Available until immediately after the 'response' event is emitted. + Available until immediately after the 'response' event is emitted. - Adds a request tail which has to complete before the request lifecycle is complete where: + Adds a request tail which has to complete before the request lifecycle is complete where: - name - an optional tail name used for logging purposes. - Returns a tail function which must be called when the tail activity is completed. + name - an optional tail name used for logging purposes. + Returns a tail function which must be called when the tail activity is completed. - Tails are actions performed throughout the request lifecycle, but which may end after a response is sent back to the client. For example, a request may trigger a database update which should not delay sending back a response. However, it is still desirable to associate the activity with the request when logging it (or an error associated with it). + Tails are actions performed throughout the request lifecycle, but which may end after a response is sent back to the client. For example, a request may trigger a database update which should not delay sending back a response. However, it is still desirable to associate the activity with the request when logging it (or an error associated with it). - When all tails completed, the server emits a 'tail' event. + When all tails completed, the server emits a 'tail' event. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - var get = function (request, reply) { + var get = function (request, reply) { var dbTail = request.tail('write to database'); @@ -1336,28 +1350,27 @@ declare module "hapi" { return reply('Success!'); }; - server.route({ method: 'GET', path: '/', handler: get }); + server.route({ method: 'GET', path: '/', handler: get }); - server.on('tail', function (request) { + server.on('tail', function (request) { console.log('Request completed including db activity'); });*/ - tail( - /** an optional tail name used for logging purposes.*/ - name?: string): Function; - } + tail(/** an optional tail name used for logging purposes.*/ + name?: string): Function; + } /** Response events - The response object supports the following events: + The response object supports the following events: - 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). - 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). - var Crypto = require('crypto'); - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); + 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). + 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). + var Crypto = require('crypto'); + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); - server.ext('onPreResponse', function (request, reply) { + server.ext('onPreResponse', function (request, reply) { var response = request.response; if (response.isBoom) { @@ -1377,277 +1390,283 @@ declare module "hapi" { return reply.continue(); });*/ - export class Response extends Events.EventEmitter { - isBoom: boolean; - /** the HTTP response status code. Defaults to 200 (except for errors).*/ - statusCode: number; - /** an object containing the response headers where each key is a header field name. Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepare for transmission.*/ - headers: IDictionary; - /** the value provided using the reply interface.*/ - source: any; + export class Response extends Events.EventEmitter { + isBoom: boolean; + /** the HTTP response status code. Defaults to 200 (except for errors).*/ + statusCode: number; + /** an object containing the response headers where each key is a header field name. Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepare for transmission.*/ + headers: IDictionary; + /** the value provided using the reply interface.*/ + source: any; /** a string indicating the type of source with available values: - 'plain' - a plain response such as string, number, null, or simple object (e.g. not a Stream, Buffer, or view). - 'buffer' - a Buffer. - 'view' - a view generated with reply.view(). - 'file' - a file generated with reply.file() of via the directory handler. - 'stream' - a Stream. - 'promise' - a Promise object. */ - variety: string; - /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ - app: any; - /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */ - plugins: any; + 'plain' - a plain response such as string, number, null, or simple object (e.g. not a Stream, Buffer, or view). + 'buffer' - a Buffer. + 'view' - a view generated with reply.view(). + 'file' - a file generated with reply.file() of via the directory handler. + 'stream' - a Stream. + 'promise' - a Promise object. */ + variety: string; + /** application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].*/ + app: any; + /** plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. */ + plugins: any; /** settings - response handling flags: - charset - the 'Content-Type' HTTP header 'charset' property. Defaults to 'utf-8'. - encoding - the string encoding scheme used to serial data into the HTTP payload when source is a string or marshals into a string. Defaults to 'utf8'. - passThrough - if true and source is a Stream, copies the statusCode and headers of the stream to the outbound response. Defaults to true. - stringify - options used for source value requiring stringification. Defaults to no replacer and no space padding. - ttl - if set, overrides the route cache expiration milliseconds value set in the route config. Defaults to no override. - varyEtag - if true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present.*/ - settings: { - charset: string; - encoding: string; - passThrough: boolean; - stringify: any; - ttl: number; - varyEtag: boolean; - } + charset - the 'Content-Type' HTTP header 'charset' property. Defaults to 'utf-8'. + encoding - the string encoding scheme used to serial data into the HTTP payload when source is a string or marshals into a string. Defaults to 'utf8'. + passThrough - if true and source is a Stream, copies the statusCode and headers of the stream to the outbound response. Defaults to true. + stringify - options used for source value requiring stringification. Defaults to no replacer and no space padding. + ttl - if set, overrides the route cache expiration milliseconds value set in the route config. Defaults to no override. + varyEtag - if true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present.*/ + settings: { + charset: string; + encoding: string; + passThrough: boolean; + stringify: any; + ttl: number; + varyEtag: boolean; + } /** sets the HTTP 'Content-Length' header (to avoid chunked transfer encoding) where: - length - the header value. Must match the actual payload size.*/ - bytes(length: number): Response; - /** sets the 'Content-Type' HTTP header 'charset' property where: charset - the charset property value.*/ - charset(charset: string): Response; + length - the header value. Must match the actual payload size.*/ + bytes(length: number): Response; + + /** sets the 'Content-Type' HTTP header 'charset' property where: charset - the charset property value.*/ + charset(charset: string): Response; /** sets the HTTP status code where: - statusCode - the HTTP status code.*/ - code(statusCode: number): Response; - /** sets the HTTP status code to Created (201) and the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/ - created(uri: string): Response; + statusCode - the HTTP status code.*/ + code(statusCode: number): Response; + + /** sets the HTTP status code to Created (201) and the HTTP 'Location' header where: uri - an absolute or relative URI used as the 'Location' header value.*/ + created(uri: string): Response; - /** encoding(encoding) - sets the string encoding scheme used to serial data into the HTTP payload where: encoding - the encoding property value (see node Buffer encoding).*/ - encoding(encoding: string): Response; + /** encoding(encoding) - sets the string encoding scheme used to serial data into the HTTP payload where: encoding - the encoding property value (see node Buffer encoding).*/ + encoding(encoding: string): Response; /** etag(tag, options) - sets the representation entity tag where: - tag - the entity tag string without the double-quote. - options - optional settings where: - weak - if true, the tag will be prefixed with the 'W/' weak signifier. Weak tags will fail to match identical tags for the purpose of determining 304 response status. Defaults to false. - vary - if true and content encoding is set or applied to the response (e.g 'gzip' or 'deflate'), the encoding name will be automatically added to the tag at transmission time (separated by a '-' character). Ignored when weak is true. Defaults to true.*/ - etag(tag: string, options: { - weak: boolean; vary: boolean; - }): Response; + tag - the entity tag string without the double-quote. + options - optional settings where: + weak - if true, the tag will be prefixed with the 'W/' weak signifier. Weak tags will fail to match identical tags for the purpose of determining 304 response status. Defaults to false. + vary - if true and content encoding is set or applied to the response (e.g 'gzip' or 'deflate'), the encoding name will be automatically added to the tag at transmission time (separated by a '-' character). Ignored when weak is true. Defaults to true.*/ + etag(tag: string, options: { + weak: boolean; vary: boolean; + }): Response; /**header(name, value, options) - sets an HTTP header where: - name - the header name. - value - the header value. - options - optional settings where: - append - if true, the value is appended to any existing header value using separator. Defaults to false. - separator - string used as separator when appending to an exiting value. Defaults to ','. - override - if false, the header value is not set if an existing value present. Defaults to true.*/ - header(name: string, value: string, options?: { - append: boolean; - separator: string; - override: boolean; - }): Response; + name - the header name. + value - the header value. + options - optional settings where: + append - if true, the value is appended to any existing header value using separator. Defaults to false. + separator - string used as separator when appending to an exiting value. Defaults to ','. + override - if false, the header value is not set if an existing value present. Defaults to true.*/ + header(name: string, value: string, options?: IHeaderOptions): Response; - /** hold() - puts the response on hold until response.send() is called. Available only after reply() is called and until response.hold() is invoked once. */ - hold():Response; + /** hold() - puts the response on hold until response.send() is called. Available only after reply() is called and until response.hold() is invoked once. */ + hold(): Response; /** location(uri) - sets the HTTP 'Location' header where: - uri - an absolute or relative URI used as the 'Location' header value.*/ - location(uri: string): Response; + uri - an absolute or relative URI used as the 'Location' header value.*/ + location(uri: string): Response; /** redirect(uri) - sets an HTTP redirection response (302) and decorates the response with additional methods listed below, where: - uri - an absolute or relative URI used to redirect the client to another resource. */ - redirect(uri: string): Response; + uri - an absolute or relative URI used to redirect the client to another resource. */ + redirect(uri: string): Response; /** replacer(method) - sets the JSON.stringify() replacer argument where: - method - the replacer function or array. Defaults to none.*/ - replacer(method: Function | Array): Response; + method - the replacer function or array. Defaults to none.*/ + replacer(method: Function | Array): Response; /** spaces(count) - sets the JSON.stringify() space argument where: - count - the number of spaces to indent nested object keys. Defaults to no indentation. */ - spaces(count: number): Response; + count - the number of spaces to indent nested object keys. Defaults to no indentation. */ + spaces(count: number): Response; + /**state(name, value, [options]) - sets an HTTP cookie where: - name - the cookie name. - value - the cookie value. If no encoding is defined, must be a string. - options - optional configuration. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ - state(name: string, value: string, options?: any): Response; + name - the cookie name. + value - the cookie value. If no encoding is defined, must be a string. + options - optional configuration. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ + state(name: string, value: string, options?: any): Response; - /** send() - resume the response which will be transmitted in the next tick. Available only after response.hold() is called and until response.send() is invoked once. */ - send():void; + /** send() - resume the response which will be transmitted in the next tick. Available only after response.hold() is called and until response.send() is invoked once. */ + send(): void; + + /** sets a string suffix when the response is process via JSON.stringify().*/ + suffix(suffix: string): void; - /** sets a string suffix when the response is process via JSON.stringify().*/ - suffix(suffix: string): void; /** overrides the default route cache expiration rule for this response instance where: -msec - the time-to-live value in milliseconds.*/ - ttl(msec: number): void; - /** type(mimeType) - sets the HTTP 'Content-Type' header where: - mimeType - is the mime type. Should only be used to override the built-in default for each response type. */ - type(mimeType: string): Response; - /** clears the HTTP cookie by setting an expired value where: -name - the cookie name. -options - optional configuration for expiring cookie. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ - unstate(name: string, options?: { [key: string]: string }): void; - /** adds the provided header to the list of inputs affected the response generation via the HTTP 'Vary' header where: -header - the HTTP request header name.*/ - vary(header: string): void; - } - /** When using the redirect() method, the response object provides these additional methods */ - export class ResponseRedirect extends Response { - /** sets the status code to 302 or 307 (based on the rewritable() setting) where: -isTemporary - if false, sets status to permanent. Defaults to true.*/ - temporary(isTemporary: boolean): void; - /** sets the status code to 301 or 308 (based on the rewritable() setting) where: -isPermanent - if true, sets status to temporary. Defaults to false. */ - permanent(isPermanent: boolean): void; - /** sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST' to 'GET'). Exact code based on the temporary() or permanent() setting. Arguments: -isRewritable - if false, sets to non-rewritable. Defaults to true. -Permanent Temporary -Rewritable 301 302(1) -Non-rewritable 308(2) 307 -Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ - rewritable(isRewritable: boolean): void; - } - /** info about a server connection */ - export interface IServerConnectionInfo { - /** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/ - id: string; - /** - the connection creation timestamp.*/ - created: number; - /** - the connection start timestamp (0 when stopped).*/ - started: number; - /** the connection port based on the following rules: - the configured port value before the server has been started. - the actual port assigned when no port is configured or set to 0 after the server has been started.*/ - port: number; + msec - the time-to-live value in milliseconds.*/ + ttl(msec: number): void; - /** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/ - host: string; - /** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/ - address: string; - /** - the protocol used: - 'http' - HTTP. - 'https' - HTTPS. - 'socket' - UNIX domain socket or Windows named pipe.*/ - protocol: string; - /** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/ - uri: string; - } - /** - * undocumented. The connection object constructed after calling server.connection(); - * can be accessed via server.connections; or request.connection; - */ - export class ServerConnection extends Events.EventEmitter { - domain: any; - _events: { route: Function, domain: Function, _events: Function, _eventsCount: Function, _maxListeners: Function }; - _eventsCount: number; - settings: IServerConnectionOptions; - server: Server; - /** ex: "tcp" */ - type: string; - _started: boolean; - /** dictionary of sockets */ - _connections: { [ip_port: string]: any }; - _onConnection: Function; - registrations: any; - _extensions: any; - _requestCounter: { value: number; min: number; max: number }; - _load: any; - states: { - settings: any; cookies: any; names: any[] - }; - auth: { connection: ServerConnection; _schemes: any; _strategies: any; settings: any; api: any; }; - _router: any; - MSPluginsCollection: any; - applicationCache: any; - addEventListener: any; - info: IServerConnectionInfo; - } + /** type(mimeType) - sets the HTTP 'Content-Type' header where: + mimeType - is the mime type. Should only be used to override the built-in default for each response type. */ + type(mimeType: string): Response; + + /** clears the HTTP cookie by setting an expired value where: + name - the cookie name. + options - optional configuration for expiring cookie. If the state was previously registered with the server using server.state(), the specified keys in options override those same keys in the server definition (but not others).*/ + unstate(name: string, options?: { [key: string]: string }): Response; + + /** adds the provided header to the list of inputs affected the response generation via the HTTP 'Vary' header where: + header - the HTTP request header name.*/ + vary(header: string): void; + } + /** When using the redirect() method, the response object provides these additional methods */ + export class ResponseRedirect extends Response { + /** sets the status code to 302 or 307 (based on the rewritable() setting) where: + isTemporary - if false, sets status to permanent. Defaults to true.*/ + temporary(isTemporary: boolean): void; + + /** sets the status code to 301 or 308 (based on the rewritable() setting) where: + isPermanent - if true, sets status to temporary. Defaults to false. */ + permanent(isPermanent: boolean): void; + + /** sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST' to 'GET'). Exact code based on the temporary() or permanent() setting. Arguments: + isRewritable - if false, sets to non-rewritable. Defaults to true. + Permanent Temporary + Rewritable 301 302(1) + Non-rewritable 308(2) 307 + Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ + rewritable(isRewritable: boolean): void; + } + /** info about a server connection */ + export interface IServerConnectionInfo { + /** - a unique connection identifier (using the format '{hostname}:{pid}:{now base36}').*/ + id: string; + /** - the connection creation timestamp.*/ + created: number; + /** - the connection start timestamp (0 when stopped).*/ + started: number; + /** the connection port based on the following rules: + the configured port value before the server has been started. + the actual port assigned when no port is configured or set to 0 after the server has been started.*/ + port: number; + + /** - the host name the connection was configured to. Defaults to the operating system hostname when available, otherwise 'localhost'.*/ + host: string; + /** - the active IP address the connection was bound to after starting.Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket).*/ + address: string; + /** - the protocol used: + 'http' - HTTP. + 'https' - HTTPS. + 'socket' - UNIX domain socket or Windows named pipe.*/ + protocol: string; + /** a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri setting if provided, otherwise constructed from the available settings. If no port is available or set to 0, the uri will not include a port component.*/ + uri: string; + } + /** + * undocumented. The connection object constructed after calling server.connection(); + * can be accessed via server.connections; or request.connection; + */ + export class ServerConnection extends Events.EventEmitter { + domain: any; + _events: { route: Function, domain: Function, _events: Function, _eventsCount: Function, _maxListeners: Function }; + _eventsCount: number; + settings: IServerConnectionOptions; + server: Server; + /** ex: "tcp" */ + type: string; + _started: boolean; + /** dictionary of sockets */ + _connections: { [ip_port: string]: any }; + _onConnection: Function; + registrations: any; + _extensions: any; + _requestCounter: { value: number; min: number; max: number }; + _load: any; + states: { + settings: any; cookies: any; names: any[] + }; + auth: { connection: ServerConnection; _schemes: any; _strategies: any; settings: any; api: any; }; + _router: any; + MSPluginsCollection: any; + applicationCache: any; + addEventListener: any; + info: IServerConnectionInfo; + } /** Server http://hapijs.com/api#server - rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080). - Server events - The server object inherits from Events.EventEmitter and emits the following events: - 'log' - events logged with server.log() and server events generated internally by the framework. - 'start' - emitted when the server is started using server.start(). - 'stop' - emitted when the server is stopped using server.stop(). - 'request' - events generated by request.log(). Does not include any internally generated events. - 'request-internal' - request events generated internally by the framework (multiple events per request). - 'request-error' - emitted whenever an Internal Server Error (500) error response is sent. Single event per request. - 'response' - emitted after the response is sent back to the client (or when the client connection closed and no response sent, in which case request.response is null). Single event per request. - 'tail' - emitted when a request finished processing, including any registered tails. Single event per request. - Note that the server object should not be used to emit application events as its internal implementation is designed to fan events out to the various plugin selections and not for application events. - MORE EVENTS HERE: http://hapijs.com/api#server-events*/ - export class Server extends Events.EventEmitter { + rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080). + Server events + The server object inherits from Events.EventEmitter and emits the following events: + 'log' - events logged with server.log() and server events generated internally by the framework. + 'start' - emitted when the server is started using server.start(). + 'stop' - emitted when the server is stopped using server.stop(). + 'request' - events generated by request.log(). Does not include any internally generated events. + 'request-internal' - request events generated internally by the framework (multiple events per request). + 'request-error' - emitted whenever an Internal Server Error (500) error response is sent. Single event per request. + 'response' - emitted after the response is sent back to the client (or when the client connection closed and no response sent, in which case request.response is null). Single event per request. + 'tail' - emitted when a request finished processing, including any registered tails. Single event per request. + Note that the server object should not be used to emit application events as its internal implementation is designed to fan events out to the various plugin selections and not for application events. + MORE EVENTS HERE: http://hapijs.com/api#server-events*/ + export class Server extends Events.EventEmitter { + + constructor(options?: IServerOptions); - constructor(options?: IServerOptions); /** Provides a safe place to store server-specific run-time application data without potential conflicts with the framework internals. The data can be accessed whenever the server is accessible. Initialized with an empty object. - var Hapi = require('hapi'); - server = new Hapi.Server(); - server.app.key = 'value'; - var handler = function (request, reply) { + var Hapi = require('hapi'); + server = new Hapi.Server(); + server.app.key = 'value'; + var handler = function (request, reply) { return reply(request.server.app.key); }; */ - app: any; + app: any; /** An array containing the server's connections. When the server object is returned from server.select(), the connections array only includes the connections matching the selection criteria. - var server = new Hapi.Server(); - server.connection({ port: 80, labels: 'a' }); - server.connection({ port: 8080, labels: 'b' }); - // server.connections.length === 2 - var a = server.select('a'); - // a.connections.length === 1*/ - connections: Array; + var server = new Hapi.Server(); + server.connection({ port: 80, labels: 'a' }); + server.connection({ port: 8080, labels: 'b' }); + // server.connections.length === 2 + var a = server.select('a'); + // a.connections.length === 1*/ + connections: Array; /** When the server contains exactly one connection, info is an object containing information about the sole connection. - * When the server contains more than one connection, each server.connections array member provides its own connection.info. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // server.info.port === 80 - server.connection({ port: 8080 }); - // server.info === null - // server.connections[1].info.port === 8080 - */ - info: IServerConnectionInfo; + * When the server contains more than one connection, each server.connections array member provides its own connection.info. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + // server.info.port === 80 + server.connection({ port: 8080 }); + // server.info === null + // server.connections[1].info.port === 8080 + */ + info: IServerConnectionInfo; /** An object containing the process load metrics (when load.sampleInterval is enabled): - rss - RSS memory usage. - var Hapi = require('hapi'); - var server = new Hapi.Server({ load: { sampleInterval: 1000 } }); - console.log(server.load.rss);*/ - load: { - /** - event loop delay milliseconds.*/ - eventLoopDelay: number; - /** - V8 heap usage.*/ - heapUsed: number; - }; + rss - RSS memory usage. + var Hapi = require('hapi'); + var server = new Hapi.Server({ load: { sampleInterval: 1000 } }); + console.log(server.load.rss);*/ + load: { + /** - event loop delay milliseconds.*/ + eventLoopDelay: number; + /** - V8 heap usage.*/ + heapUsed: number; + }; /** When the server contains exactly one connection, listener is the node HTTP server object of the sole connection. - When the server contains more than one connection, each server.connections array member provides its own connection.listener. - var Hapi = require('hapi'); - var SocketIO = require('socket.io'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var io = SocketIO.listen(server.listener); - io.sockets.on('connection', function(socket) { + When the server contains more than one connection, each server.connections array member provides its own connection.listener. + var Hapi = require('hapi'); + var SocketIO = require('socket.io'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + var io = SocketIO.listen(server.listener); + io.sockets.on('connection', function(socket) { socket.emit({ msg: 'welcome' }); });*/ - listener: http.Server; + listener: http.Server; /** server.methods - An object providing access to the server methods where each server method name is an object property. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.method('add', function (a, b, next) { + An object providing access to the server methods where each server method name is an object property. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.method('add', function (a, b, next) { return next(null, a + b); }); - server.methods.add(1, 2, function (err, result) { + server.methods.add(1, 2, function (err, result) { // result === 3 });*/ - methods: IDictionary; + methods: IDictionary; /** server.mime - Provides access to the server MIME database used for setting content-type information. The object must not be modified directly but only through the mime server setting. - var Hapi = require('hapi'); - var options = { + Provides access to the server MIME database used for setting content-type information. The object must not be modified directly but only through the mime server setting. + var Hapi = require('hapi'); + var options = { mime: { override: { 'node/module': { @@ -1659,86 +1678,86 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ } } }; - var server = new Hapi.Server(options); - // server.mime.path('code.js').type === 'application/javascript' - // server.mime.path('file.npm').type === 'node/module'*/ - mime: any; + var server = new Hapi.Server(options); + // server.mime.path('code.js').type === 'application/javascript' + // server.mime.path('file.npm').type === 'node/module'*/ + mime: any; /**server.plugins - An object containing the values exposed by each plugin registered where each key is a plugin name and the values are the exposed properties by each plugin using server.expose(). Plugins may set the value of the server.plugins[name] object directly or via the server.expose() method. - exports.register = function (server, options, next) { + An object containing the values exposed by each plugin registered where each key is a plugin name and the values are the exposed properties by each plugin using server.expose(). Plugins may set the value of the server.plugins[name] object directly or via the server.expose() method. + exports.register = function (server, options, next) { server.expose('key', 'value'); // server.plugins.example.key === 'value' return next(); }; - exports.register.attributes = { + exports.register.attributes = { name: 'example' };*/ - plugins: IDictionary; + plugins: IDictionary; /** server.realm - The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. - modifiers - when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes: - route - routes preferences: - prefix - the route path prefix used by any calls to server.route() from the server. - vhost - the route virtual host settings used by any calls to server.route() from the server. - plugin - the active plugin name (empty string if at the server root). - plugins - plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. - settings - settings overrides: - files.relativeTo - bind - The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). - exports.register = function (server, options, next) { + The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(), the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin). Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties. + modifiers - when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes: + route - routes preferences: + prefix - the route path prefix used by any calls to server.route() from the server. + vhost - the route virtual host settings used by any calls to server.route() from the server. + plugin - the active plugin name (empty string if at the server root). + plugins - plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. + settings - settings overrides: + files.relativeTo + bind + The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]). + exports.register = function (server, options, next) { console.log(server.realm.modifiers.route.prefix); return next(); };*/ - realm: IServerRealm; + realm: IServerRealm; /** server.root - The root server object containing all the connections and the root server methods (e.g. start(), stop(), connection()).*/ - root: Server; + The root server object containing all the connections and the root server methods (e.g. start(), stop(), connection()).*/ + root: Server; /** server.settings - The server configuration object after defaults applied. - var Hapi = require('hapi'); - var server = new Hapi.Server({ + The server configuration object after defaults applied. + var Hapi = require('hapi'); + var server = new Hapi.Server({ app: { key: 'value' } }); - // server.settings.app === { key: 'value' }*/ - settings: IServerOptions; + // server.settings.app === { key: 'value' }*/ + settings: IServerOptions; /** server.version - The hapi module version number. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - // server.version === '8.0.0'*/ - version: string; + The hapi module version number. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + // server.version === '8.0.0'*/ + version: string; /** server.after(method, [dependencies]) - Adds a method to be called after all the plugin dependencies have been registered and before the server starts (only called if the server is started) where: - after - the method with signature function(plugin, next) where: - server - server object the after() method was called on. - next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: - err - internal error which is returned back via the server.start() callback. - dependencies - a string or array of string with the plugin names to call this method after their after() methods. There is no requirement for the other plugins to be registered. Setting dependencies only arranges the after methods in the specified order. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.after(function () { + Adds a method to be called after all the plugin dependencies have been registered and before the server starts (only called if the server is started) where: + after - the method with signature function(plugin, next) where: + server - server object the after() method was called on. + next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: + err - internal error which is returned back via the server.start() callback. + dependencies - a string or array of string with the plugin names to call this method after their after() methods. There is no requirement for the other plugins to be registered. Setting dependencies only arranges the after methods in the specified order. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.after(function () { // Perform some pre-start logic }); - server.start(function (err) { + server.start(function (err) { // After method already executed }); - server.auth.default(options)*/ - after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string | string[]): void; + server.auth.default(options)*/ + after(method: (plugin: any, next: (err: any) => void) => void, dependencies: string | string[]): void; - auth: { - /** server.auth.api - An object where each key is a strategy name and the value is the exposed strategy API. Available on when the authentication scheme exposes an API by returning an api key in the object returned from its implementation function. - When the server contains more than one connection, each server.connections array member provides its own connection.auth.api object. - const server = new Hapi.Server(); - server.connection({ port: 80 }); - const scheme = function (server, options) { + auth: { + /** server.auth.api + An object where each key is a strategy name and the value is the exposed strategy API. Available on when the authentication scheme exposes an API by returning an api key in the object returned from its implementation function. + When the server contains more than one connection, each server.connections array member provides its own connection.auth.api object. + const server = new Hapi.Server(); + server.connection({ port: 80 }); + const scheme = function (server, options) { return { api: { settings: { @@ -1755,45 +1774,45 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ } }; }; - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - console.log(server.auth.api.default.settings.x); // 5 - */ - api: { - [index: string]: any; - } + server.auth.scheme('custom', scheme); + server.auth.strategy('default', 'custom'); + console.log(server.auth.api.default.settings.x); // 5 + */ + api: { + [index: string]: any; + } /** server.auth.default(options) - Sets a default strategy which is applied to every route where: - options - a string with the default strategy name or an object with a specified strategy or strategies using the same format as the route auth handler options. - The default does not apply when the route config specifies auth as false, or has an authentication strategy configured. Otherwise, the route authentication config is applied to the defaults. Note that the default only applies at time of route configuration, not at runtime. Calling default() after adding a route will have no impact on routes added prior. - The default auth strategy configuration can be accessed via connection.auth.settings.default. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.auth.default('default'); - server.route({ + Sets a default strategy which is applied to every route where: + options - a string with the default strategy name or an object with a specified strategy or strategies using the same format as the route auth handler options. + The default does not apply when the route config specifies auth as false, or has an authentication strategy configured. Otherwise, the route authentication config is applied to the defaults. Note that the default only applies at time of route configuration, not at runtime. Calling default() after adding a route will have no impact on routes added prior. + The default auth strategy configuration can be accessed via connection.auth.settings.default. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.auth.scheme('custom', scheme); + server.auth.strategy('default', 'custom'); + server.auth.default('default'); + server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply(request.auth.credentials.user); } });*/ - default(options: string): void; - default(options: { strategy: string }): void; - default(options: { strategies: string[] }): void; + default(options: string): void; + default(options: { strategy: string }): void; + default(options: { strategies: string[] }): void; /** server.auth.scheme(name, scheme) - Registers an authentication scheme where: - name - the scheme name. - scheme - the method implementing the scheme with signature function(server, options) where: - server - a reference to the server object the scheme is added to. - options - optional scheme settings used to instantiate a strategy.*/ - scheme(name: string, - /** When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. If the err returned by the reply() method includes a message, no additional strategies will be attempted. If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. - n the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'. - server = new Hapi.Server(); - server.connection({ port: 80 }); - scheme = function (server, options) { + Registers an authentication scheme where: + name - the scheme name. + scheme - the method implementing the scheme with signature function(server, options) where: + server - a reference to the server object the scheme is added to. + options - optional scheme settings used to instantiate a strategy.*/ + scheme(name: string, + /** When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route. If the err returned by the reply() method includes a message, no additional strategies will be attempted. If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference. + n the scheme payload() method returns an error with a message, it means payload validation failed due to bad payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), authentication may still be successful if the route auth.payload configuration is set to 'optional'. + server = new Hapi.Server(); + server.connection({ port: 80 }); + scheme = function (server, options) { urn { authenticate: function (request, reply) { req = request.raw.req; @@ -1805,20 +1824,20 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ } }; }; - */ - scheme: (server: Server, options: any) => IServerAuthScheme): void; + */ + scheme: (server: Server, options: any) => IServerAuthScheme): void; /** server.auth.strategy(name, scheme, [mode], [options]) - Registers an authentication strategy where: - name - the strategy name. - scheme - the scheme name (must be previously registered using server.auth.scheme()). - mode - if true, the scheme is automatically assigned as a required strategy to any route without an auth config. Can only be assigned to a single server strategy. Value must be true (which is the same as 'required') or a valid authentication mode ('required', 'optional', 'try'). Defaults to false. - options - scheme options based on the scheme requirements. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.route({ + Registers an authentication strategy where: + name - the strategy name. + scheme - the scheme name (must be previously registered using server.auth.scheme()). + mode - if true, the scheme is automatically assigned as a required strategy to any route without an auth config. Can only be assigned to a single server strategy. Value must be true (which is the same as 'required') or a valid authentication mode ('required', 'optional', 'try'). Defaults to false. + options - scheme options based on the scheme requirements. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.auth.scheme('custom', scheme); + server.auth.strategy('default', 'custom'); + server.route({ method: 'GET', path: '/', config: { @@ -1828,21 +1847,21 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ } } });*/ - strategy(name: string, scheme: any, mode?: boolean | string, options?: any): void; + strategy(name: string, scheme: any, mode?: boolean | string, options?: any): void; /** server.auth.test(strategy, request, next) - Tests a request against an authentication strategy where: - strategy - the strategy name registered with server.auth.strategy(). - request - the request object. - next - the callback function with signature function(err, credentials) where: - err - the error if authentication failed. - credentials - the authentication credentials object if authentication was successful. - Note that the test() method does not take into account the route authentication configuration. It also does not perform payload authentication. It is limited to the basic strategy authentication execution. It does not include verifying scope, entity, or other route properties. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.auth.scheme('custom', scheme); - server.auth.strategy('default', 'custom'); - server.route({ + Tests a request against an authentication strategy where: + strategy - the strategy name registered with server.auth.strategy(). + request - the request object. + next - the callback function with signature function(err, credentials) where: + err - the error if authentication failed. + credentials - the authentication credentials object if authentication was successful. + Note that the test() method does not take into account the route authentication configuration. It also does not perform payload authentication. It is limited to the basic strategy authentication execution. It does not include verifying scope, entity, or other route properties. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.auth.scheme('custom', scheme); + server.auth.strategy('default', 'custom'); + server.route({ method: 'GET', path: '/', handler: function (request, reply) { @@ -1854,16 +1873,17 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ }); } });*/ - test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void; - }; + test(strategy: string, request: Request, next: (err: any, credentials: any) => void): void; + }; + /** server.bind(context) - Sets a global context used as the default bind object when adding a route or an extension where: - context - the object used to bind this in handler and extension methods. - When setting context inside a plugin, the context is applied only to methods set up by the plugin. Note that the context applies only to routes and extensions added after it has been set. - var handler = function (request, reply) { + Sets a global context used as the default bind object when adding a route or an extension where: + context - the object used to bind this in handler and extension methods. + When setting context inside a plugin, the context is applied only to methods set up by the plugin. Note that the context applies only to routes and extensions added after it has been set. + var handler = function (request, reply) { return reply(this.message); }; - exports.register = function (server, options, next) { + exports.register = function (server, options, next) { var bind = { message: 'hello' }; @@ -1871,231 +1891,233 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ server.route({ method: 'GET', path: '/', handler: handler }); return next(); };*/ - bind(context: any): void; + bind(context: any): void; /** server.cache(options) - Provisions a cache segment within the server cache facility where: - options - catbox policy configuration where: - expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. - expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records expire. Uses local time. Cannot be used together with expiresIn. - generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: - id - the id string or object provided to the get() method. - next - the method called when the new item is returned with the signature function(err, value, ttl) where: - err - an error condition. - value - the new value generated. - ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. - staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. - staleTimeout - number of milliseconds to wait before checking if an item is stale. - generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests. - cache - the cache name configured in 'server.cache`. Defaults to the default cache. - segment - string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. Required when called outside of a plugin. - shared - if true, allows multiple cache provisions to share the same segment. Default to false. - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var cache = server.cache({ segment: 'countries', expiresIn: 60 * 60 * 1000 }); - cache.set('norway', { capital: 'oslo' }, null, function (err) { + Provisions a cache segment within the server cache facility where: + options - catbox policy configuration where: + expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. + expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records expire. Uses local time. Cannot be used together with expiresIn. + generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: - id - the id string or object provided to the get() method. - next - the method called when the new item is returned with the signature function(err, value, ttl) where: - err - an error condition. - value - the new value generated. - ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. + staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. + staleTimeout - number of milliseconds to wait before checking if an item is stale. + generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests. + cache - the cache name configured in 'server.cache`. Defaults to the default cache. + segment - string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. Required when called outside of a plugin. + shared - if true, allows multiple cache provisions to share the same segment. Default to false. + var server = new Hapi.Server(); + server.connection({ port: 80 }); + var cache = server.cache({ segment: 'countries', expiresIn: 60 * 60 * 1000 }); + cache.set('norway', { capital: 'oslo' }, null, function (err) { cache.get('norway', function (err, value, cached, log) { // value === { capital: 'oslo' }; }); });*/ - cache(options: ICatBoxCacheOptions): void; + cache(options: ICatBoxCacheOptions): void; /** server.connection([options]) - Adds an incoming server connection - Returns a server object with the new connection selected. - Must be called before any other server method that modifies connections is called for it to apply to the new connection (e.g. server.state()). - Note that the options object is deeply cloned (with the exception of listener which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - var web = server.connection({ port: 8000, host: 'example.com', labels: ['web'] }); - var admin = server.connection({ port: 8001, host: 'example.com', labels: ['admin'] }); - // server.connections.length === 2 - // web.connections.length === 1 - // admin.connections.length === 1 */ - connection(options: IServerConnectionOptions): Server; + Adds an incoming server connection + Returns a server object with the new connection selected. + Must be called before any other server method that modifies connections is called for it to apply to the new connection (e.g. server.state()). + Note that the options object is deeply cloned (with the exception of listener which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + var web = server.connection({ port: 8000, host: 'example.com', labels: ['web'] }); + var admin = server.connection({ port: 8001, host: 'example.com', labels: ['admin'] }); + // server.connections.length === 2 + // web.connections.length === 1 + // admin.connections.length === 1 */ + connection(options: IServerConnectionOptions): Server; + /** server.decorate(type, property, method, [options]) - Extends various framework interfaces with custom methods where: - type - the interface being decorated. Supported types: - 'reply' - adds methods to the reply interface. - 'server' - adds methods to the Server object. - property - the object decoration key name. - method - the extension function. - options - if the type is 'request', supports the following optional settings: - 'apply' - if true, the method function is invoked using the signature function(request) where request is the current request object and the returned value is assigned as the decoration. - Note that decorations apply to the entire server and all its connections regardless of current selection. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.decorate('reply', 'success', function () { + Extends various framework interfaces with custom methods where: + type - the interface being decorated. Supported types: + 'reply' - adds methods to the reply interface. + 'server' - adds methods to the Server object. + property - the object decoration key name. + method - the extension function. + options - if the type is 'request', supports the following optional settings: + 'apply' - if true, the method function is invoked using the signature function(request) where request is the current request object and the returned value is assigned as the decoration. + Note that decorations apply to the entire server and all its connections regardless of current selection. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.decorate('reply', 'success', function () { return this.response({ status: 'ok' }); }); - server.route({ + server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply.success(); } });*/ - decorate(type: string, property: string, method: Function, options?: { apply: boolean }): void; + decorate(type: string, property: string, method: Function, options?: { apply: boolean }): void; /** server.dependency(dependencies, [after]) - Used within a plugin to declares a required dependency on other plugins where: - dependencies - a single string or array of plugin name strings which must be registered in order for this plugin to operate. Plugins listed must be registered before the server is started. Does not provide version dependency which should be implemented using npm peer dependencies. - after - an optional function called after all the specified dependencies have been registered and before the server starts. The function is only called if the server is started. If a circular dependency is detected, an exception is thrown (e.g. two plugins each has an after function to be called after the other). The function signature is function(server, next) where: - server - the server the dependency() method was called on. - next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: - err - internal error condition, which is returned back via the server.start() callback. - exports.register = function (server, options, next) { + Used within a plugin to declares a required dependency on other plugins where: + dependencies - a single string or array of plugin name strings which must be registered in order for this plugin to operate. Plugins listed must be registered before the server is started. Does not provide version dependency which should be implemented using npm peer dependencies. + after - an optional function called after all the specified dependencies have been registered and before the server starts. The function is only called if the server is started. If a circular dependency is detected, an exception is thrown (e.g. two plugins each has an after function to be called after the other). The function signature is function(server, next) where: + server - the server the dependency() method was called on. + next - the callback function the method must call to return control over to the application and complete the registration process. The function signature is function(err) where: + err - internal error condition, which is returned back via the server.start() callback. + exports.register = function (server, options, next) { server.dependency('yar', after); return next(); }; - var after = function (server, next) { + var after = function (server, next) { // Additional plugin registration logic return next(); };*/ - dependency(dependencies: string | string[], after?: (server: Server, next: (err: any) => void) => void): void; + dependency(dependencies: string | string[], after?: (server: Server, next: (err: any) => void) => void): void; /** server.expose(key, value) - Used within a plugin to expose a property via server.plugins[name] where: - key - the key assigned (server.plugins[name][key]). - value - the value assigned. - exports.register = function (server, options, next) { + Used within a plugin to expose a property via server.plugins[name] where: + key - the key assigned (server.plugins[name][key]). + value - the value assigned. + exports.register = function (server, options, next) { server.expose('util', function () { console.log('something'); }); return next(); };*/ - expose(key: string, value: any): void; + expose(key: string, value: any): void; /** server.expose(obj) - Merges a deep copy of an object into to the existing content of server.plugins[name] where: - obj - the object merged into the exposed properties container. - exports.register = function (server, options, next) { + Merges a deep copy of an object into to the existing content of server.plugins[name] where: + obj - the object merged into the exposed properties container. + exports.register = function (server, options, next) { server.expose({ util: function () { console.log('something'); } }); return next(); };*/ - expose(obj: any): void; + expose(obj: any): void; /** server.ext(event, method, [options]) - Registers an extension function in one of the available extension points where: - event - the event name. - method - a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is function(request, reply) where: - request - the request object. NOTE: Access the Response via request.response - reply - the reply interface which is used to return control back to the framework. To continue normal execution of the request lifecycle, reply.continue() must be called. To abort processing and return a response to the client, call reply(value) where value is an error or any other valid response. - this - the object provided via options.bind or the current active context set with server.bind(). - options - an optional object with the following: - before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. - after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. - bind - a context object passed back to the provided method (via this) when called. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.ext('onRequest', function (request, reply) { + Registers an extension function in one of the available extension points where: + event - the event name. + method - a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is function(request, reply) where: + request - the request object. NOTE: Access the Response via request.response + reply - the reply interface which is used to return control back to the framework. To continue normal execution of the request lifecycle, reply.continue() must be called. To abort processing and return a response to the client, call reply(value) where value is an error or any other valid response. + this - the object provided via options.bind or the current active context set with server.bind(). + options - an optional object with the following: + before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + bind - a context object passed back to the provided method (via this) when called. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.ext('onRequest', function (request, reply) { // Change all requests to '/test' request.setUrl('/test'); return reply.continue(); }); - var handler = function (request, reply) { + var handler = function (request, reply) { return reply({ status: 'ok' }); }; - server.route({ method: 'GET', path: '/test', handler: handler }); - server.start(); - // All requests will get routed to '/test'*/ - ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; + server.route({ method: 'GET', path: '/test', handler: handler }); + server.start(); + // All requests will get routed to '/test'*/ + ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; /** server.handler(name, method) - Registers a new handler type to be used in routes where: - name - string name for the handler being registered. Cannot override the built-in handler types (directory, file, proxy, and view) or any previously registered type. - method - the function used to generate the route handler using the signature function(route, options) where: - route - the route public interface object. - options - the configuration object provided in the handler config. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ host: 'localhost', port: 8000 }); - // Defines new handler for routes on this server - server.handler('test', function (route, options) { + Registers a new handler type to be used in routes where: + name - string name for the handler being registered. Cannot override the built-in handler types (directory, file, proxy, and view) or any previously registered type. + method - the function used to generate the route handler using the signature function(route, options) where: + route - the route public interface object. + options - the configuration object provided in the handler config. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ host: 'localhost', port: 8000 }); + // Defines new handler for routes on this server + server.handler('test', function (route, options) { return function (request, reply) { return reply('new handler: ' + options.msg); } }); - server.route({ + server.route({ method: 'GET', path: '/', handler: { test: { msg: 'test' } } }); - server.start(); - The method function can have a defaults object or function property. If the property is set to an object, that object is used as the default route config for routes using this handler. If the property is set to a function, the function uses the signature function(method) and returns the route default configuration. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ host: 'localhost', port: 8000 }); - var handler = function (route, options) { + server.start(); + The method function can have a defaults object or function property. If the property is set to an object, that object is used as the default route config for routes using this handler. If the property is set to a function, the function uses the signature function(method) and returns the route default configuration. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ host: 'localhost', port: 8000 }); + var handler = function (route, options) { return function (request, reply) { return reply('new handler: ' + options.msg); } }; - // Change the default payload processing for this handler - handler.defaults = { + // Change the default payload processing for this handler + handler.defaults = { payload: { output: 'stream', parse: false } }; - server.handler('test', handler);*/ - handler(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void; + server.handler('test', handler);*/ + handler(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void; - /** server.initialize([callback]) - Initializes the server (starts the caches, finalizes plugin registration) but does not start listening - on the connection ports, where: - - `callback` - the callback method when server initialization is completed or failed with the signature - `function(err)` where: - - `err` - any initialization error condition. + /** server.initialize([callback]) + Initializes the server (starts the caches, finalizes plugin registration) but does not start listening + on the connection ports, where: + - `callback` - the callback method when server initialization is completed or failed with the signature + `function(err)` where: + - `err` - any initialization error condition. - If no `callback` is provided, a `Promise` object is returned. + If no `callback` is provided, a `Promise` object is returned. - Note that if the method fails and the callback includes an error, the server is considered to be in - an undefined state and should be shut down. In most cases it would be impossible to fully recover as - the various plugins, caches, and other event listeners will get confused by repeated attempts to - start the server or make assumptions about the healthy state of the environment. It is recommended - to assert that no error has been returned after calling `initialize()` to abort the process when the - server fails to start properly. If you must try to resume after an error, call `server.stop()` - first to reset the server state. - */ - initialize(callback?: (error: any) => void): IPromise; + Note that if the method fails and the callback includes an error, the server is considered to be in + an undefined state and should be shut down. In most cases it would be impossible to fully recover as + the various plugins, caches, and other event listeners will get confused by repeated attempts to + start the server or make assumptions about the healthy state of the environment. It is recommended + to assert that no error has been returned after calling `initialize()` to abort the process when the + server fails to start properly. If you must try to resume after an error, call `server.stop()` + first to reset the server state. + */ + initialize(callback?: (error: any) => void): IPromise; - /** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection. - Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack. - Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties - * When the server contains more than one connection, each server.connections array member provides its own connection.inject(). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - var handler = function (request, reply) { + /** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection. + Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack. + Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties + * When the server contains more than one connection, each server.connections array member provides its own connection.inject(). + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + var handler = function (request, reply) { return reply('Success!'); }; - server.route({ method: 'GET', path: '/', handler: handler }); - server.inject('/', function (res) { + server.route({ method: 'GET', path: '/', handler: handler }); + server.inject('/', function (res) { console.log(res.result); }); - */ - inject: IServerInject; + */ + inject: IServerInject; /** server.log(tags, [data, [timestamp]]) - Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or output to the console. The arguments are: - tags - a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events. Any logs generated by the server internally include the 'hapi' tag along with event-specific information. - data - an optional message string or object with the application data being logged. - timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.on('log', function (event, tags) { + Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or output to the console. The arguments are: + tags - a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events. Any logs generated by the server internally include the 'hapi' tag along with event-specific information. + data - an optional message string or object with the application data being logged. + timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now). + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.on('log', function (event, tags) { if (tags.error) { console.log(event); } }); - server.log(['test', 'error'], 'Test event');*/ - log(tags: string | string[], data?: string | any, timestamp?: number): void; + server.log(['test', 'error'], 'Test event');*/ + log(tags: string | string[], data?: string | any, timestamp?: number): void; + /**server.lookup(id) - When the server contains exactly one connection, looks up a route configuration where: - id - the route identifier as set in the route options. - returns the route public interface object if found, otherwise null. - var server = new Hapi.Server(); - server.connection(); - server.route({ + When the server contains exactly one connection, looks up a route configuration where: + id - the route identifier as set in the route options. + returns the route public interface object if found, otherwise null. + var server = new Hapi.Server(); + server.connection(); + server.route({ method: 'GET', path: '/', config: { @@ -2103,18 +2125,19 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ id: 'root' } }); - var route = server.lookup('root'); - When the server contains more than one connection, each server.connections array member provides its own connection.lookup() method.*/ - lookup(id: string): IRoute; + var route = server.lookup('root'); + When the server contains more than one connection, each server.connections array member provides its own connection.lookup() method.*/ + lookup(id: string): IRoute; + /** server.match(method, path, [host]) - When the server contains exactly one connection, looks up a route configuration where: - method - the HTTP method (e.g. 'GET', 'POST'). - path - the requested path (must begin with '/'). - host - optional hostname (to match against routes with vhost). - returns the route public interface object if found, otherwise null. - var server = new Hapi.Server(); - server.connection(); - server.route({ + When the server contains exactly one connection, looks up a route configuration where: + method - the HTTP method (e.g. 'GET', 'POST'). + path - the requested path (must begin with '/'). + host - optional hostname (to match against routes with vhost). + returns the route public interface object if found, otherwise null. + var server = new Hapi.Server(); + server.connection(); + server.route({ method: 'GET', path: '/', config: { @@ -2122,69 +2145,66 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ id: 'root' } }); - var route = server.match('get', '/'); - When the server contains more than one connection, each server.connections array member provides its own connection.match() method.*/ - match(method: string, path: string, host?: string): IRoute; - - + var route = server.match('get', '/'); + When the server contains more than one connection, each server.connections array member provides its own connection.match() method.*/ + match(method: string, path: string, host?: string): IRoute; /** server.method(name, method, [options]) - Registers a server method. Server methods are functions registered with the server and used throughout the application as a common utility. Their advantage is in the ability to configure them to use the built-in cache and share across multiple request handlers without having to create a common module. - Methods are registered via server.method(name, method, [options]) - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // Simple arguments - var add = function (a, b, next) { + Registers a server method. Server methods are functions registered with the server and used throughout the application as a common utility. Their advantage is in the ability to configure them to use the built-in cache and share across multiple request handlers without having to create a common module. + Methods are registered via server.method(name, method, [options]) + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + // Simple arguments + var add = function (a, b, next) { return next(null, a + b); }; - server.method('sum', add, { cache: { expiresIn: 2000 } }); - server.methods.sum(4, 5, function (err, result) { + server.method('sum', add, { cache: { expiresIn: 2000 } }); + server.methods.sum(4, 5, function (err, result) { console.log(result); }); - // Object argument - var addArray = function (array, next) { + // Object argument + var addArray = function (array, next) { var sum = 0; array.forEach(function (item) { sum += item; }); return next(null, sum); }; - server.method('sumObj', addArray, { + server.method('sumObj', addArray, { cache: { expiresIn: 2000 }, generateKey: function (array) { return array.join(','); } }); - server.methods.sumObj([5, 6], function (err, result) { + server.methods.sumObj([5, 6], function (err, result) { console.log(result); }); - // Synchronous method with cache - var addSync = function (a, b) { + // Synchronous method with cache + var addSync = function (a, b) { return a + b; }; - server.method('sumSync', addSync, { cache: { expiresIn: 2000 }, callback: false }); - server.methods.sumSync(4, 5, function (err, result) { + server.method('sumSync', addSync, { cache: { expiresIn: 2000 }, callback: false }); + server.methods.sumSync(4, 5, function (err, result) { console.log(result); }); */ - method( - /** a unique method name used to invoke the method via server.methods[name]. When configured with caching enabled, server.methods[name].cache.drop(arg1, arg2, ..., argn, callback) can be used to clear the cache for a given key. Supports using nested names such as utils.users.get which will automatically create the missing path under server.methods and can be accessed for the previous example via server.methods.utils.users.get.*/ - name: string, - method: IServerMethod, - options?: IServerMethodOptions): void; + method(/** a unique method name used to invoke the method via server.methods[name]. When configured with caching enabled, server.methods[name].cache.drop(arg1, arg2, ..., argn, callback) can be used to clear the cache for a given key. Supports using nested names such as utils.users.get which will automatically create the missing path under server.methods and can be accessed for the previous example via server.methods.utils.users.get.*/ + name: string, + method: IServerMethod, + options?: IServerMethodOptions): void; /**server.method(methods) - Registers a server method function as described in server.method() using a configuration object where: - methods - an object or an array of objects where each one contains: - name - the method name. - method - the method function. - options - optional settings. - var add = function (a, b, next) { + Registers a server method function as described in server.method() using a configuration object where: + methods - an object or an array of objects where each one contains: + name - the method name. + method - the method function. + options - optional settings. + var add = function (a, b, next) { next(null, a + b); }; - server.method({ + server.method({ name: 'sum', method: add, options: { @@ -2193,134 +2213,139 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ } } });*/ - method(methods: { - name: string; method: IServerMethod; options?: IServerMethodOptions - } | Array<{ - name: string; method: IServerMethod; options?: IServerMethodOptions - }>): void; + method(methods: { + name: string; method: IServerMethod; options?: IServerMethodOptions + } | Array<{ + name: string; method: IServerMethod; options?: IServerMethodOptions + }>): void; + /**server.path(relativeTo) - Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: - relativeTo - the path prefix added to any relative file path starting with '.'. - Note that setting a path within a plugin only applies to resources accessed by plugin methods. If no path is set, the connection files.relativeTo configuration is used. The path only applies to routes added after it has been set. - exports.register = function (server, options, next) { + Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: + relativeTo - the path prefix added to any relative file path starting with '.'. + Note that setting a path within a plugin only applies to resources accessed by plugin methods. If no path is set, the connection files.relativeTo configuration is used. The path only applies to routes added after it has been set. + exports.register = function (server, options, next) { server.path(__dirname + '../static'); server.route({ path: '/file', method: 'GET', handler: { file: './test.html' } }); next(); };*/ - path(relativeTo: string): void; + path(relativeTo: string): void; /** - * server.register(plugins, [options], callback) - * Registers a plugin where: - * plugins - an object or array of objects where each one is either: - * a plugin registration function. - * an object with the following: - * register - the plugin registration function. - * options - optional options passed to the registration function when called. - * options - optional registration options (different from the options passed to the registration function): - * select - a string or array of string labels used to pre-select connections for plugin registration. - * routes - modifiers applied to each route added by the plugin: - * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific prefix. - * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. - * callback - the callback function with signature function(err) where: - * err - an error returned from the registration function. Note that exceptions thrown by the registration function are not handled by the framework. - * - * If no callback is provided, a Promise object is returned. - */ - register(plugins: any | any[], options: { - select: string | string[]; - routes: { - prefix: string; vhost?: string | string[] - }; - }, callback: (err: any) => void): void; - register(plugins: any | any[], options: { - select: string | string[]; - routes: { - prefix: string; vhost?: string | string[] - }; - }): IPromise; + * server.register(plugins, [options], callback) + * Registers a plugin where: + * plugins - an object or array of objects where each one is either: + * a plugin registration function. + * an object with the following: + * register - the plugin registration function. + * options - optional options passed to the registration function when called. + * options - optional registration options (different from the options passed to the registration function): + * select - a string or array of string labels used to pre-select connections for plugin registration. + * routes - modifiers applied to each route added by the plugin: + * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific prefix. + * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. + * callback - the callback function with signature function(err) where: + * err - an error returned from the registration function. Note that exceptions thrown by the registration function are not handled by the framework. + * + * If no callback is provided, a Promise object is returned. + */ + register(plugins: any | any[], options: { + select: string | string[]; + routes: { + prefix: string; vhost?: string | string[] + }; + }, callback: (err: any) => void): void; + register(plugins: any | any[], options: { + select: string | string[]; + routes: { + prefix: string; vhost?: string | string[] + }; + }): IPromise; - register(plugins: any | any[], callback: (err: any) => void): void; - register(plugins: any | any[]): IPromise; + register(plugins: any | any[], callback: (err: any) => void): void; + register(plugins: any | any[]): IPromise; /**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). - context - optional object used by the template to render context-specific result. Defaults to no context ({}). - options - optional object used to override the views manager configuration. - callback - the callback function with signature function (err, rendered, config) where: - err - the rendering error if any. - rendered - the result view string. - config - the configuration used to render the template. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.views({ + 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). + context - optional object used by the template to render context-specific result. Defaults to no context ({}). + options - optional object used to override the views manager configuration. + callback - the callback function with signature function (err, rendered, config) where: + err - the rendering error if any. + rendered - the result view string. + config - the configuration used to render the template. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.views({ engines: { html: require('handlebars') }, path: __dirname + '/templates' }); - var context = { + var context = { title: 'Views Example', message: 'Hello, World' }; - server.render('hello', context, function (err, rendered, config) { + server.render('hello', context, function (err, rendered, config) { console.log(rendered); });*/ - render(template: string, context: any, options: any, callback: (err: any, rendered: any, config: any) => void): void; + render(template: string, context: any, options: any, callback: (err: any, rendered: any, config: any) => void): void; + /** server.route(options) - Adds a connection route where: - options - a route configuration object or an array of configuration objects. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply('ok'); } }); - server.route([ - { method: 'GET', path: '/1', handler: function (request, reply) { return reply('ok'); } }, - { method: 'GET', path: '/2', handler: function (request, reply) { return reply('ok'); } } - ]);*/ - route(options: IRouteConfiguration): void; - route(options: IRouteConfiguration[]): void; + Adds a connection route where: + options - a route configuration object or an array of configuration objects. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.route({ method: 'GET', path: '/', handler: function (request, reply) { return reply('ok'); } }); + server.route([ + { method: 'GET', path: '/1', handler: function (request, reply) { return reply('ok'); } }, + { method: 'GET', path: '/2', handler: function (request, reply) { return reply('ok'); } } + ]);*/ + route(options: IRouteConfiguration): void; + route(options: IRouteConfiguration[]): void; + /**server.select(labels) - Selects a subset of the server's connections where: - labels - a single string or array of strings of labels used as a logical OR statement to select all the connections with matching labels in their configuration. - Returns a server object with connections set to the requested subset. Selecting again on a selection operates as a logic AND statement between the individual selections. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, labels: ['a'] }); - server.connection({ port: 8080, labels: ['b'] }); - server.connection({ port: 8081, labels: ['c'] }); - server.connection({ port: 8082, labels: ['c','d'] }); - var a = server.select('a'); // The server with port 80 - var ab = server.select(['a','b']); // A list of servers containing the server with port 80 and the server with port 8080 - var c = server.select('c'); // A list of servers containing the server with port 8081 and the server with port 8082 */ - select(labels: string | string[]): Server | Server[]; + Selects a subset of the server's connections where: + labels - a single string or array of strings of labels used as a logical OR statement to select all the connections with matching labels in their configuration. + Returns a server object with connections set to the requested subset. Selecting again on a selection operates as a logic AND statement between the individual selections. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80, labels: ['a'] }); + server.connection({ port: 8080, labels: ['b'] }); + server.connection({ port: 8081, labels: ['c'] }); + server.connection({ port: 8082, labels: ['c','d'] }); + var a = server.select('a'); // The server with port 80 + var ab = server.select(['a','b']); // A list of servers containing the server with port 80 and the server with port 8080 + var c = server.select('c'); // A list of servers containing the server with port 8081 and the server with port 8082 */ + select(labels: string | string[]): Server | Server[]; + /** server.start([callback]) - Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where: - callback - optional callback when server startup is completed or failed with the signature function(err) where: - err - any startup error condition. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.start(function (err) { + Starts the server connections by listening for incoming requests on the configured port of each listener (unless the connection was configured with autoListen set to false), where: + callback - optional callback when server startup is completed or failed with the signature function(err) where: + err - any startup error condition. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.start(function (err) { console.log('Server started at: ' + server.info.uri); });*/ - start(callback?: (err: any) => void): IPromise; + start(callback?: (err: any) => void): IPromise; + /** server.state(name, [options]) - HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions - State defaults can be modified via the server connections.routes.state configuration option. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - // Set cookie definition - server.state('session', { + HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions + State defaults can be modified via the server connections.routes.state configuration option. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + // Set cookie definition + server.state('session', { ttl: 24 * 60 * 60 * 1000, // One day isSecure: true, path: '/', encoding: 'base64json' }); - // Set state in route handler - var handler = function (request, reply) { + // Set state in route handler + var handler = function (request, reply) { var session = request.state.session; if (!session) { session = { user: 'joe' }; @@ -2328,74 +2353,75 @@ Notes: 1. Default value. 2. Proposed code, not supported by all clients. */ session.last = Date.now(); return reply('Success').state('session', session); }; - Registered cookies are automatically parsed when received. Parsing rules depends on the route state.parse configuration. If an incoming registered cookie fails parsing, it is not included in request.state, regardless of the state.failAction setting. When state.failAction is set to 'log' and an invalid cookie value is received, the server will emit a 'request-internal' event. To capture these errors subscribe to the 'request-internal' events and filter on 'error' and 'state' tags: - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.on('request-internal', function (request, event, tags) { + Registered cookies are automatically parsed when received. Parsing rules depends on the route state.parse configuration. If an incoming registered cookie fails parsing, it is not included in request.state, regardless of the state.failAction setting. When state.failAction is set to 'log' and an invalid cookie value is received, the server will emit a 'request-internal' event. To capture these errors subscribe to the 'request-internal' events and filter on 'error' and 'state' tags: + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.on('request-internal', function (request, event, tags) { if (tags.error && tags.state) { console.error(event); } - }); */ - state(name: string, options?: ICookieSettings): void; + }); */ + state(name: string, options?: ICookieSettings): void; /** server.stop([options], [callback]) - Stops the server's connections by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where: - options - optional object with: - timeout - overrides the timeout in millisecond before forcefully terminating a connection. Defaults to 5000 (5 seconds). - callback - optional callback method with signature function() which is called once all the connections have ended and it is safe to exit the process. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80 }); - server.stop({ timeout: 60 * 1000 }, function () { + Stops the server's connections by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where: + options - optional object with: + timeout - overrides the timeout in millisecond before forcefully terminating a connection. Defaults to 5000 (5 seconds). + callback - optional callback method with signature function() which is called once all the connections have ended and it is safe to exit the process. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80 }); + server.stop({ timeout: 60 * 1000 }, function () { console.log('Server stopped'); });*/ - stop(options?: { timeout: number }, callback?: () => void): IPromise; + stop(options?: { timeout: number }, callback?: () => void): IPromise; + /**server.table([host]) - Returns a copy of the routing table where: - host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. - The return value is an array where each item is an object containing: - info - the connection.info the connection the table was generated for. - labels - the connection labels. - table - an array of routes where each route contains: - settings - the route config with defaults applied. - method - the HTTP method in lower case. - path - the route path. - Note that if the server has not been started and multiple connections use port 0, the table items will override each other and will produce an incomplete result. - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, host: 'example.com' }); - server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); - var table = server.table(); - When calling connection.table() directly on each connection, the return value is the same as the array table item value of an individual connection: - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.connection({ port: 80, host: 'example.com' }); - server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); - var table = server.connections[0].table(); - //[ - // { + Returns a copy of the routing table where: + host - optional host to filter routes matching a specific virtual host. Defaults to all virtual hosts. + The return value is an array where each item is an object containing: + info - the connection.info the connection the table was generated for. + labels - the connection labels. + table - an array of routes where each route contains: + settings - the route config with defaults applied. + method - the HTTP method in lower case. + path - the route path. + Note that if the server has not been started and multiple connections use port 0, the table items will override each other and will produce an incomplete result. + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80, host: 'example.com' }); + server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); + var table = server.table(); + When calling connection.table() directly on each connection, the return value is the same as the array table item value of an individual connection: + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.connection({ port: 80, host: 'example.com' }); + server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } }); + var table = server.connections[0].table(); + //[ + // { // method: 'get', // path: '/example', // settings: { ... } // } - //] - */ - table(host?: any): IConnectionTable; + //] + */ + table(host?: any): IConnectionTable; /**server.views(options) - Initializes the server views manager - var Hapi = require('hapi'); - var server = new Hapi.Server(); - server.views({ + Initializes the server views manager + var Hapi = require('hapi'); + var server = new Hapi.Server(); + server.views({ engines: { html: require('handlebars'), jade: require('jade') }, path: '/static/templates' }); - When server.views() is called within a plugin, the views manager is only available to plugins methods.*/ - views(options: IServerViewsConfiguration): void; + When server.views() is called within a plugin, the views manager is only available to plugins methods.*/ + views(options: IServerViewsConfiguration): void; - } + } } diff --git a/html-entities/html-entities-tests.ts b/html-entities/html-entities-tests.ts new file mode 100644 index 0000000000..d9c4f76ce7 --- /dev/null +++ b/html-entities/html-entities-tests.ts @@ -0,0 +1,10 @@ +/// + +import * as htmlEntities from "html-entities"; + +let entities = new htmlEntities.AllHtmlEntities(); + +console.log(entities.encode('<>"\'&©®')); // <>"'&©® +console.log(entities.encodeNonUTF('<>"\'&©®')); // <>"'&©® +console.log(entities.encodeNonASCII('<>"\'&©®')); // <>"\'&©® +console.log(entities.decode('<>"'&©®∆')); // <>"'&©®∆ \ No newline at end of file diff --git a/html-entities/html-entities.d.ts b/html-entities/html-entities.d.ts new file mode 100644 index 0000000000..1539b0c4d5 --- /dev/null +++ b/html-entities/html-entities.d.ts @@ -0,0 +1,17 @@ +// Type definitions for html-entities v1.2.0 +// Project: https://www.npmjs.com/package/html-entities +// Definitions by: Xavier Stouder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "html-entities" { + abstract class Entities { + encode(toEncode: string): string; + encodeNonUTF(toEncode: string): string; + encodeNonASCII(toEncode: string): string; + decode(toDecode: string): string; + } + class XmlEntities extends Entities {} + class Html4Entities extends Entities {} + class Html5Entities extends Entities {} + class AllHtmlEntities extends Entities {} +} \ No newline at end of file diff --git a/html2canvas/html2canvas.d.ts b/html2canvas/html2canvas.d.ts index 101815ec47..1d5fd82fe7 100644 --- a/html2canvas/html2canvas.d.ts +++ b/html2canvas/html2canvas.d.ts @@ -36,6 +36,9 @@ declare namespace Html2Canvas { /** Whether to attempt to load cross-origin images as CORS served, before reverting back to proxy. */ useCORS?: boolean; + + /** Use svg powered rendering where available (FF11+). */ + svgRendering?: boolean; /** Callback providing the rendered canvas element after rendering */ onrendered?(canvas: HTMLCanvasElement): void; diff --git a/http-status/http-status-tests.ts b/http-status/http-status-tests.ts index 8717e99c3a..12971578fb 100644 --- a/http-status/http-status-tests.ts +++ b/http-status/http-status-tests.ts @@ -39,7 +39,9 @@ str = httpStatus[414]; str = httpStatus[415]; str = httpStatus[416]; str = httpStatus[417]; +str = httpStatus[422]; str = httpStatus[429]; +str = httpStatus[451]; str = httpStatus[500]; str = httpStatus[501]; str = httpStatus[502]; @@ -82,7 +84,9 @@ nmr = httpStatus.REQUEST_URI_TOO_LONG; nmr = httpStatus.UNSUPPORTED_MEDIA_TYPE; nmr = httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE; nmr = httpStatus.EXPECTATION_FAILED; +nmr = httpStatus.UNPROCESSABLE_ENTITY; nmr = httpStatus.TOO_MANY_REQUESTS; +nmr = httpStatus.UNAVAILABLE_FOR_LEGAL_REASONS; nmr = httpStatus.INTERNAL_SERVER_ERROR; nmr = httpStatus.NOT_IMPLEMENTED; nmr = httpStatus.BAD_GATEWAY; diff --git a/http-status/http-status.d.ts b/http-status/http-status.d.ts index d3b12582e4..4beb5aed83 100644 --- a/http-status/http-status.d.ts +++ b/http-status/http-status.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-status v0.1.8 +// Type definitions for http-status v0.2.1 // Project: https://github.com/wdavidw/node-http-status // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -38,7 +38,9 @@ interface HttpStatus { 415: string; 416: string; 417: string; + 422: string; 429: string; + 451: string; 500: string; 501: string; 502: string; @@ -79,7 +81,9 @@ interface HttpStatus { UNSUPPORTED_MEDIA_TYPE: number; REQUESTED_RANGE_NOT_SATISFIABLE: number; EXPECTATION_FAILED: number; + UNPROCESSABLE_ENTITY: number; TOO_MANY_REQUESTS: number; + UNAVAILABLE_FOR_LEGAL_REASONS: number; INTERNAL_SERVER_ERROR: number; NOT_IMPLEMENTED: number; BAD_GATEWAY: number; diff --git a/iconv/iconv-tests.ts b/iconv/iconv-tests.ts new file mode 100644 index 0000000000..5c121c1b45 --- /dev/null +++ b/iconv/iconv-tests.ts @@ -0,0 +1,28 @@ +/// + +import {Iconv} from "iconv"; +import {Writable} from "stream"; + +const iconv: Iconv.Iconv = new Iconv("utf-8", "cp932"); +const iconvFromFunction: Iconv.Iconv = Iconv("utf-8", "cp932"); + +iconv.writable = true; + +let buffer: Buffer; + +buffer = iconv.convert("hoge"); +buffer = iconv.convert("hoge", "utf-8"); +buffer = iconv.convert(new Buffer("hoge"), "utf-8"); + +let result: boolean; + +result = iconv.write("hoge"); +result = iconv.write("hoge", "utf-8"); +result = iconv.write(new Buffer("hoge"), "utf-8"); + +iconv.end(); +iconv.end("hoge"); +iconv.end("hoge", "utf-8"); +iconv.end(new Buffer("hoge"), "utf-8"); + +const st: Writable = iconv.pipe(new Writable, {end: true}); diff --git a/iconv/iconv.d.ts b/iconv/iconv.d.ts new file mode 100644 index 0000000000..9e21b4bbe6 --- /dev/null +++ b/iconv/iconv.d.ts @@ -0,0 +1,39 @@ +// Type definitions for iconv 2.1.11 +// Project: https://github.com/bnoordhuis/node-iconv +// Definitions by: delphinus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Iconv { + + interface Static { + + new(fromEncoding: string, toEncoding: string): Iconv; + (fromEncoding: string, toEncoding: string): Iconv; + } + + interface Iconv extends NodeJS.WritableStream { + + writable: boolean; + convert(input: string | Buffer, encoding?: string): Buffer; + write(input: string | Buffer, encoding?: string): boolean; + end(input?: string | Buffer, encoding?: string): void; + + // copy from NodeJS.WritableStream for compatibility + write(buffer: Buffer|string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + + // copy from stream.Stream + pipe(destination: T, options?: { end?: boolean; }): T; + } +} + +declare module "iconv" { + + var Iconv: Iconv.Static; +} diff --git a/immutability-helper/immutability-helper-tests.ts b/immutability-helper/immutability-helper-tests.ts new file mode 100644 index 0000000000..2229278d36 --- /dev/null +++ b/immutability-helper/immutability-helper-tests.ts @@ -0,0 +1,50 @@ +/// + +import * as update from 'immutability-helper'; +import { newContext } from 'immutability-helper'; + +namespace TestObjectUpdate { + update({}, { + foo: { + bar: { $set: 'baz' } + } + }); +} + +namespace TestArrayUpdate { + update([], { + foo: { + bar: { $set: 'baz' } + } + }); +} + +namespace TestExtend { + update.extend('$command', (specValue, originalValue) => originalValue); +} + +namespace TestNewContext { + update.newContext().extend('$command', (specValue, originalValue) => originalValue); + newContext().extend('$command', (specValue, originalValue) => originalValue); + + // This shouldn't compile, but we can't test negatives. + // newContext().newContext(); +} + +namespace TestFromReactDocs { + // These are copied from https://facebook.github.io/react/docs/update.html + let initialArray = [1, 2, 3]; + let newArray = update(initialArray, { $push: [4] }); // => [1, 2, 3, 4] + + let collection = [1, 2, { a: [12, 17, 15] }]; + let newCollection = update(collection, { 2: { a: { $splice: [[1, 1, 13, 14]] } } }); + // => [1, 2, {a: [12, 13, 14, 15]}] + + let obj = { a: 5, b: 3 }; + let newObj = update(obj, { b: { $apply: function(x: number) { return x * 2; } } }); + // => {a: 5, b: 6} + let newObj2 = update(obj, { b: { $set: obj.b * 2 } }); + + let objShallow = { a: 5, b: 3 }; + let newObjShallow = update(obj, { $merge: { b: 6, c: 7 } }); // => {a: 5, b: 6, c: 7} +} diff --git a/immutability-helper/immutability-helper.d.ts b/immutability-helper/immutability-helper.d.ts new file mode 100644 index 0000000000..5941f5da6e --- /dev/null +++ b/immutability-helper/immutability-helper.d.ts @@ -0,0 +1,41 @@ +// Type definitions for immutability-helper v2.0.0 +// Project: https://github.com/kolodny/immutability-helper +// Definitions by: Sean Kelley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "immutability-helper" { + interface UpdateSpecCommand { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + [customCommand: string]: any; + } + + interface UpdateSpecPath { + [pathPart: string]: UpdateSpec; + } + + type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; + + interface UpdateArraySpec extends UpdateSpecCommand { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + [customCommand: string]: any; + } + + type CommandHandler = (specValue: any, originalValue: any) => any; + + interface UpdateFunction { + (value: any[], spec: UpdateArraySpec): any[]; + (value: {}, spec: UpdateSpec): any; + extend: (commandName: string, handler: CommandHandler) => any; + } + + interface Update extends UpdateFunction { + newContext(): UpdateFunction; + } + + const update: Update; + export = update; +} diff --git a/ioredis/ioredis-tests.ts b/ioredis/ioredis-tests.ts new file mode 100644 index 0000000000..9280367917 --- /dev/null +++ b/ioredis/ioredis-tests.ts @@ -0,0 +1,54 @@ +/// + +import * as Redis from "ioredis"; +var redis = new Redis(); + +redis.set('foo', 'bar'); +redis.get('foo', function(err, result) { + console.log(result); +}); + +// Or using a promise if the last argument isn't a function +redis.get('foo').then(function(result: any) { + console.log(result); +}); + +// Arguments to commands are flattened, so the following are the same: +redis.sadd('set', 1, 3, 5, 7); +redis.sadd('set', [1, 3, 5, 7]); + +// All arguments are passed directly to the redis server: +redis.set('key', 100, 'EX', 10); + +new Redis() // Connect to 127.0.0.1:6379 +new Redis(6380) // 127.0.0.1:6380 +new Redis(6379, '192.168.1.1') // 192.168.1.1:6379 +new Redis('/tmp/redis.sock') +new Redis({ + port: 6379, // Redis port + host: '127.0.0.1', // Redis host + family: 4, // 4 (IPv4) or 6 (IPv6) + password: 'auth', + db: 0 +}) + +var pub = new Redis(); +redis.subscribe('news', 'music', function(err: any, count: any) { + // Now we are subscribed to both the 'news' and 'music' channels. + // `count` represents the number of channels we are currently subscribed to. + + pub.publish('news', 'Hello world!'); + pub.publish('music', 'Hello again!'); +}); + +redis.on('message', function(channel: any, message: any) { + // Receive message Hello world! from channel news + // Receive message Hello again! from channel music + console.log('Receive message %s from channel %s', message, channel); +}); + +// There's also an event called 'messageBuffer', which is the same as 'message' except +// it returns buffers instead of strings. +redis.on('messageBuffer', function(channel: any, message: any) { + // Both `channel` and `message` are buffers. +}); diff --git a/ioredis/ioredis.d.ts b/ioredis/ioredis.d.ts new file mode 100644 index 0000000000..d8cd4b3c70 --- /dev/null +++ b/ioredis/ioredis.d.ts @@ -0,0 +1,699 @@ +// Type definitions for ioredis +// Project: https://github.com/luin/ioredis +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* =================== USAGE =================== + import * as Redis from "ioredis"; + var redis = new Redis(); + =============================================== */ + +/// + +declare module "ioredis" { + + + interface RedisStatic { + new (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new (options: IORedis.RedisOptions): IORedis.Redis; + new (url: string): IORedis.Redis; + (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (options: IORedis.RedisOptions): IORedis.Redis; + (url: string): IORedis.Redis; + Cluster: IORedis.Cluster; + } + + var redis: RedisStatic; + export = redis; +} +declare module IORedis { + interface Commander { + new (): Commander; + getBuiltinCommands(): string[]; + createBuiltinCommand(commandName: string): {}; + defineCommand(name: string, definition: { + numberOfKeys?: number; + lua?: string; + }): any; + sendCommand(): void; + } + + interface Redis extends NodeJS.EventEmitter, Commander { + connect(callback: Function): Promise; + disconnect(): void; + duplicate(): Redis; + monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise; + + send_command(command: string, ...args: any[]): any; + auth(password: string, callback?: ResCallbackT): any; + ping(callback?: ResCallbackT): any; + append(key: string, value: string, callback?: ResCallbackT): any; + bitcount(key: string, callback?: ResCallbackT): any; + bitcount(key: string, start: number, end: number, callback?: ResCallbackT): any; + set(key: string, value: string, callback?: ResCallbackT): any; + get(key: string, callback?: ResCallbackT): any; + exists(key: string, value: string, callback?: ResCallbackT): any; + publish(channel: string, value: any): any; + subscribe(channel: string): any; + get(args: any[], callback?: ResCallbackT): any; + get(...args: any[]): any; + set(args: any[], callback?: ResCallbackT): any; + set(...args: any[]): any; + setnx(args: any[], callback?: ResCallbackT): any; + setnx(...args: any[]): any; + setex(args: any[], callback?: ResCallbackT): any; + setex(...args: any[]): any; + append(args: any[], callback?: ResCallbackT): any; + append(...args: any[]): any; + strlen(args: any[], callback?: ResCallbackT): any; + strlen(...args: any[]): any; + del(args: any[], callback?: ResCallbackT): any; + del(...args: any[]): any; + exists(args: any[], callback?: ResCallbackT): any; + exists(...args: any[]): any; + setbit(args: any[], callback?: ResCallbackT): any; + setbit(...args: any[]): any; + getbit(args: any[], callback?: ResCallbackT): any; + getbit(...args: any[]): any; + setrange(args: any[], callback?: ResCallbackT): any; + setrange(...args: any[]): any; + getrange(args: any[], callback?: ResCallbackT): any; + getrange(...args: any[]): any; + substr(args: any[], callback?: ResCallbackT): any; + substr(...args: any[]): any; + incr(args: any[], callback?: ResCallbackT): any; + incr(...args: any[]): any; + decr(args: any[], callback?: ResCallbackT): any; + decr(...args: any[]): any; + mget(args: any[], callback?: ResCallbackT): any; + mget(...args: any[]): any; + rpush(...args: any[]): any; + lpush(args: any[], callback?: ResCallbackT): any; + lpush(...args: any[]): any; + rpushx(args: any[], callback?: ResCallbackT): any; + rpushx(...args: any[]): any; + lpushx(args: any[], callback?: ResCallbackT): any; + lpushx(...args: any[]): any; + linsert(args: any[], callback?: ResCallbackT): any; + linsert(...args: any[]): any; + rpop(args: any[], callback?: ResCallbackT): any; + rpop(...args: any[]): any; + lpop(args: any[], callback?: ResCallbackT): any; + lpop(...args: any[]): any; + brpop(args: any[], callback?: ResCallbackT): any; + brpop(...args: any[]): any; + brpoplpush(args: any[], callback?: ResCallbackT): any; + brpoplpush(...args: any[]): any; + blpop(args: any[], callback?: ResCallbackT): any; + blpop(...args: any[]): any; + llen(args: any[], callback?: ResCallbackT): any; + llen(...args: any[]): any; + lindex(args: any[], callback?: ResCallbackT): any; + lindex(...args: any[]): any; + lset(args: any[], callback?: ResCallbackT): any; + lset(...args: any[]): any; + lrange(args: any[], callback?: ResCallbackT): any; + lrange(...args: any[]): any; + ltrim(args: any[], callback?: ResCallbackT): any; + ltrim(...args: any[]): any; + lrem(args: any[], callback?: ResCallbackT): any; + lrem(...args: any[]): any; + rpoplpush(args: any[], callback?: ResCallbackT): any; + rpoplpush(...args: any[]): any; + sadd(args: any[], callback?: ResCallbackT): any; + sadd(...args: any[]): any; + srem(args: any[], callback?: ResCallbackT): any; + srem(...args: any[]): any; + smove(args: any[], callback?: ResCallbackT): any; + smove(...args: any[]): any; + sismember(args: any[], callback?: ResCallbackT): any; + sismember(...args: any[]): any; + scard(args: any[], callback?: ResCallbackT): any; + scard(...args: any[]): any; + spop(args: any[], callback?: ResCallbackT): any; + spop(...args: any[]): any; + srandmember(args: any[], callback?: ResCallbackT): any; + srandmember(...args: any[]): any; + sinter(args: any[], callback?: ResCallbackT): any; + sinter(...args: any[]): any; + sinterstore(args: any[], callback?: ResCallbackT): any; + sinterstore(...args: any[]): any; + sunion(args: any[], callback?: ResCallbackT): any; + sunion(...args: any[]): any; + sunionstore(args: any[], callback?: ResCallbackT): any; + sunionstore(...args: any[]): any; + sdiff(args: any[], callback?: ResCallbackT): any; + sdiff(...args: any[]): any; + sdiffstore(args: any[], callback?: ResCallbackT): any; + sdiffstore(...args: any[]): any; + smembers(args: any[], callback?: ResCallbackT): any; + smembers(...args: any[]): any; + zadd(args: any[], callback?: ResCallbackT): any; + zadd(...args: any[]): any; + zincrby(args: any[], callback?: ResCallbackT): any; + zincrby(...args: any[]): any; + zrem(args: any[], callback?: ResCallbackT): any; + zrem(...args: any[]): any; + zremrangebyscore(args: any[], callback?: ResCallbackT): any; + zremrangebyscore(...args: any[]): any; + zremrangebyrank(args: any[], callback?: ResCallbackT): any; + zremrangebyrank(...args: any[]): any; + zunionstore(args: any[], callback?: ResCallbackT): any; + zunionstore(...args: any[]): any; + zinterstore(args: any[], callback?: ResCallbackT): any; + zinterstore(...args: any[]): any; + zrange(args: any[], callback?: ResCallbackT): any; + zrange(...args: any[]): any; + zrangebyscore(args: any[], callback?: ResCallbackT): any; + zrangebyscore(...args: any[]): any; + zrevrangebyscore(args: any[], callback?: ResCallbackT): any; + zrevrangebyscore(...args: any[]): any; + zcount(args: any[], callback?: ResCallbackT): any; + zcount(...args: any[]): any; + zrevrange(args: any[], callback?: ResCallbackT): any; + zrevrange(...args: any[]): any; + zcard(args: any[], callback?: ResCallbackT): any; + zcard(...args: any[]): any; + zscore(args: any[], callback?: ResCallbackT): any; + zscore(...args: any[]): any; + zrank(args: any[], callback?: ResCallbackT): any; + zrank(...args: any[]): any; + zrevrank(args: any[], callback?: ResCallbackT): any; + zrevrank(...args: any[]): any; + hset(args: any[], callback?: ResCallbackT): any; + hset(...args: any[]): any; + hsetnx(args: any[], callback?: ResCallbackT): any; + hsetnx(...args: any[]): any; + hget(args: any[], callback?: ResCallbackT): any; + hget(...args: any[]): any; + hmset(args: any[], callback?: ResCallbackT): any; + hmset(key: string, hash: any, callback?: ResCallbackT): any; + hmset(...args: any[]): any; + hmget(args: any[], callback?: ResCallbackT): any; + hmget(...args: any[]): any; + hincrby(args: any[], callback?: ResCallbackT): any; + hincrby(...args: any[]): any; + hdel(args: any[], callback?: ResCallbackT): any; + hdel(...args: any[]): any; + hlen(args: any[], callback?: ResCallbackT): any; + hlen(...args: any[]): any; + hkeys(args: any[], callback?: ResCallbackT): any; + hkeys(...args: any[]): any; + hvals(args: any[], callback?: ResCallbackT): any; + hvals(...args: any[]): any; + hgetall(args: any[], callback?: ResCallbackT): any; + hgetall(...args: any[]): any; + hgetall(key: string, callback?: ResCallbackT): any; + hexists(args: any[], callback?: ResCallbackT): any; + hexists(...args: any[]): any; + incrby(args: any[], callback?: ResCallbackT): any; + incrby(...args: any[]): any; + decrby(args: any[], callback?: ResCallbackT): any; + decrby(...args: any[]): any; + getset(args: any[], callback?: ResCallbackT): any; + getset(...args: any[]): any; + mset(args: any[], callback?: ResCallbackT): any; + mset(...args: any[]): any; + msetnx(args: any[], callback?: ResCallbackT): any; + msetnx(...args: any[]): any; + randomkey(args: any[], callback?: ResCallbackT): any; + randomkey(...args: any[]): any; + select(args: any[], callback?: ResCallbackT): void; + select(...args: any[]): void; + move(args: any[], callback?: ResCallbackT): any; + move(...args: any[]): any; + rename(args: any[], callback?: ResCallbackT): any; + rename(...args: any[]): any; + renamenx(args: any[], callback?: ResCallbackT): any; + renamenx(...args: any[]): any; + expire(args: any[], callback?: ResCallbackT): any; + expire(...args: any[]): any; + expireat(args: any[], callback?: ResCallbackT): any; + expireat(...args: any[]): any; + keys(args: any[], callback?: ResCallbackT): any; + keys(...args: any[]): any; + dbsize(args: any[], callback?: ResCallbackT): any; + dbsize(...args: any[]): any; + auth(args: any[], callback?: ResCallbackT): void; + auth(...args: any[]): void; + ping(args: any[], callback?: ResCallbackT): any; + ping(...args: any[]): any; + echo(args: any[], callback?: ResCallbackT): any; + echo(...args: any[]): any; + save(args: any[], callback?: ResCallbackT): any; + save(...args: any[]): any; + bgsave(args: any[], callback?: ResCallbackT): any; + bgsave(...args: any[]): any; + bgrewriteaof(args: any[], callback?: ResCallbackT): any; + bgrewriteaof(...args: any[]): any; + shutdown(args: any[], callback?: ResCallbackT): any; + shutdown(...args: any[]): any; + lastsave(args: any[], callback?: ResCallbackT): any; + lastsave(...args: any[]): any; + type(args: any[], callback?: ResCallbackT): any; + type(...args: any[]): any; + multi(args: any[], callback?: ResCallbackT): Pipeline; + multi(...args: any[]): Pipeline; + exec(args: any[], callback?: ResCallbackT): any; + exec(...args: any[]): any; + discard(args: any[], callback?: ResCallbackT): any; + discard(...args: any[]): any; + sync(args: any[], callback?: ResCallbackT): any; + sync(...args: any[]): any; + flushdb(args: any[], callback?: ResCallbackT): any; + flushdb(...args: any[]): any; + flushall(args: any[], callback?: ResCallbackT): any; + flushall(...args: any[]): any; + sort(args: any[], callback?: ResCallbackT): any; + sort(...args: any[]): any; + info(args: any[], callback?: ResCallbackT): any; + info(...args: any[]): any; + monitor(args: any[], callback?: ResCallbackT): any; + monitor(...args: any[]): any; + ttl(args: any[], callback?: ResCallbackT): any; + ttl(...args: any[]): any; + persist(args: any[], callback?: ResCallbackT): any; + persist(...args: any[]): any; + slaveof(args: any[], callback?: ResCallbackT): any; + slaveof(...args: any[]): any; + debug(args: any[], callback?: ResCallbackT): any; + debug(...args: any[]): any; + config(args: any[], callback?: ResCallbackT): any; + config(...args: any[]): any; + subscribe(args: any[], callback?: ResCallbackT): any; + subscribe(...args: any[]): any; + unsubscribe(args: any[], callback?: ResCallbackT): any; + unsubscribe(...args: any[]): any; + psubscribe(args: any[], callback?: ResCallbackT): any; + psubscribe(...args: any[]): any; + punsubscribe(args: any[], callback?: ResCallbackT): any; + punsubscribe(...args: any[]): any; + publish(args: any[], callback?: ResCallbackT): any; + publish(...args: any[]): any; + watch(args: any[], callback?: ResCallbackT): any; + watch(...args: any[]): any; + unwatch(args: any[], callback?: ResCallbackT): any; + unwatch(...args: any[]): any; + cluster(args: any[], callback?: ResCallbackT): any; + cluster(...args: any[]): any; + restore(args: any[], callback?: ResCallbackT): any; + restore(...args: any[]): any; + migrate(args: any[], callback?: ResCallbackT): any; + migrate(...args: any[]): any; + dump(args: any[], callback?: ResCallbackT): any; + dump(...args: any[]): any; + object(args: any[], callback?: ResCallbackT): any; + object(...args: any[]): any; + client(args: any[], callback?: ResCallbackT): any; + client(...args: any[]): any; + eval(args: any[], callback?: ResCallbackT): any; + eval(...args: any[]): any; + evalsha(args: any[], callback?: ResCallbackT): any; + evalsha(...args: any[]): any; + script(args: any[], callback?: ResCallbackT): any; + script(...args: any[]): any; + script(key: string, callback?: ResCallbackT): any; + quit(args: any[], callback?: ResCallbackT): any; + quit(...args: any[]): any; + scan(...args: any[]): any; + scan(args: any[], callback?: ResCallbackT): any; + hscan(...args: any[]): any; + hscan(args: any[], callback?: ResCallbackT): any; + zscan(...args: any[]): any; + zscan(args: any[], callback?: ResCallbackT): any; + + pipeline(): Pipeline; + pipeline(commands: string[][]): Pipeline; + + scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + } + + interface Pipeline { + exec(callback?: ResCallbackT): any; + + get(args: any[], callback?: ResCallbackT): Pipeline; + get(...args: any[]): Pipeline; + set(args: any[], callback?: ResCallbackT): Pipeline; + set(...args: any[]): Pipeline; + setnx(args: any[], callback?: ResCallbackT): Pipeline; + setnx(...args: any[]): Pipeline; + setex(args: any[], callback?: ResCallbackT): Pipeline; + setex(...args: any[]): Pipeline; + append(args: any[], callback?: ResCallbackT): Pipeline; + append(...args: any[]): Pipeline; + strlen(args: any[], callback?: ResCallbackT): Pipeline; + strlen(...args: any[]): Pipeline; + del(args: any[], callback?: ResCallbackT): Pipeline; + del(...args: any[]): Pipeline; + exists(args: any[], callback?: ResCallbackT): Pipeline; + exists(...args: any[]): Pipeline; + setbit(args: any[], callback?: ResCallbackT): Pipeline; + setbit(...args: any[]): Pipeline; + getbit(args: any[], callback?: ResCallbackT): Pipeline; + getbit(...args: any[]): Pipeline; + setrange(args: any[], callback?: ResCallbackT): Pipeline; + setrange(...args: any[]): Pipeline; + getrange(args: any[], callback?: ResCallbackT): Pipeline; + getrange(...args: any[]): Pipeline; + substr(args: any[], callback?: ResCallbackT): Pipeline; + substr(...args: any[]): Pipeline; + incr(args: any[], callback?: ResCallbackT): Pipeline; + incr(...args: any[]): Pipeline; + decr(args: any[], callback?: ResCallbackT): Pipeline; + decr(...args: any[]): Pipeline; + mget(args: any[], callback?: ResCallbackT): Pipeline; + mget(...args: any[]): Pipeline; + rpush(...args: any[]): Pipeline; + lpush(args: any[], callback?: ResCallbackT): Pipeline; + lpush(...args: any[]): Pipeline; + rpushx(args: any[], callback?: ResCallbackT): Pipeline; + rpushx(...args: any[]): Pipeline; + lpushx(args: any[], callback?: ResCallbackT): Pipeline; + lpushx(...args: any[]): Pipeline; + linsert(args: any[], callback?: ResCallbackT): Pipeline; + linsert(...args: any[]): Pipeline; + rpop(args: any[], callback?: ResCallbackT): Pipeline; + rpop(...args: any[]): Pipeline; + lpop(args: any[], callback?: ResCallbackT): Pipeline; + lpop(...args: any[]): Pipeline; + brpop(args: any[], callback?: ResCallbackT): Pipeline; + brpop(...args: any[]): Pipeline; + brpoplpush(args: any[], callback?: ResCallbackT): Pipeline; + brpoplpush(...args: any[]): Pipeline; + blpop(args: any[], callback?: ResCallbackT): Pipeline; + blpop(...args: any[]): Pipeline; + llen(args: any[], callback?: ResCallbackT): Pipeline; + llen(...args: any[]): Pipeline; + lindex(args: any[], callback?: ResCallbackT): Pipeline; + lindex(...args: any[]): Pipeline; + lset(args: any[], callback?: ResCallbackT): Pipeline; + lset(...args: any[]): Pipeline; + lrange(args: any[], callback?: ResCallbackT): Pipeline; + lrange(...args: any[]): Pipeline; + ltrim(args: any[], callback?: ResCallbackT): Pipeline; + ltrim(...args: any[]): Pipeline; + lrem(args: any[], callback?: ResCallbackT): Pipeline; + lrem(...args: any[]): Pipeline; + rpoplpush(args: any[], callback?: ResCallbackT): Pipeline; + rpoplpush(...args: any[]): Pipeline; + sadd(args: any[], callback?: ResCallbackT): Pipeline; + sadd(...args: any[]): Pipeline; + srem(args: any[], callback?: ResCallbackT): Pipeline; + srem(...args: any[]): Pipeline; + smove(args: any[], callback?: ResCallbackT): Pipeline; + smove(...args: any[]): Pipeline; + sismember(args: any[], callback?: ResCallbackT): Pipeline; + sismember(...args: any[]): Pipeline; + scard(args: any[], callback?: ResCallbackT): Pipeline; + scard(...args: any[]): Pipeline; + spop(args: any[], callback?: ResCallbackT): Pipeline; + spop(...args: any[]): Pipeline; + srandmember(args: any[], callback?: ResCallbackT): Pipeline; + srandmember(...args: any[]): Pipeline; + sinter(args: any[], callback?: ResCallbackT): Pipeline; + sinter(...args: any[]): Pipeline; + sinterstore(args: any[], callback?: ResCallbackT): Pipeline; + sinterstore(...args: any[]): Pipeline; + sunion(args: any[], callback?: ResCallbackT): Pipeline; + sunion(...args: any[]): Pipeline; + sunionstore(args: any[], callback?: ResCallbackT): Pipeline; + sunionstore(...args: any[]): Pipeline; + sdiff(args: any[], callback?: ResCallbackT): Pipeline; + sdiff(...args: any[]): Pipeline; + sdiffstore(args: any[], callback?: ResCallbackT): Pipeline; + sdiffstore(...args: any[]): Pipeline; + smembers(args: any[], callback?: ResCallbackT): Pipeline; + smembers(...args: any[]): Pipeline; + zadd(args: any[], callback?: ResCallbackT): Pipeline; + zadd(...args: any[]): Pipeline; + zincrby(args: any[], callback?: ResCallbackT): Pipeline; + zincrby(...args: any[]): Pipeline; + zrem(args: any[], callback?: ResCallbackT): Pipeline; + zrem(...args: any[]): Pipeline; + zremrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zremrangebyscore(...args: any[]): Pipeline; + zremrangebyrank(args: any[], callback?: ResCallbackT): Pipeline; + zremrangebyrank(...args: any[]): Pipeline; + zunionstore(args: any[], callback?: ResCallbackT): Pipeline; + zunionstore(...args: any[]): Pipeline; + zinterstore(args: any[], callback?: ResCallbackT): Pipeline; + zinterstore(...args: any[]): Pipeline; + zrange(args: any[], callback?: ResCallbackT): Pipeline; + zrange(...args: any[]): Pipeline; + zrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zrangebyscore(...args: any[]): Pipeline; + zrevrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zrevrangebyscore(...args: any[]): Pipeline; + zcount(args: any[], callback?: ResCallbackT): Pipeline; + zcount(...args: any[]): Pipeline; + zrevrange(args: any[], callback?: ResCallbackT): Pipeline; + zrevrange(...args: any[]): Pipeline; + zcard(args: any[], callback?: ResCallbackT): Pipeline; + zcard(...args: any[]): Pipeline; + zscore(args: any[], callback?: ResCallbackT): Pipeline; + zscore(...args: any[]): Pipeline; + zrank(args: any[], callback?: ResCallbackT): Pipeline; + zrank(...args: any[]): Pipeline; + zrevrank(args: any[], callback?: ResCallbackT): Pipeline; + zrevrank(...args: any[]): Pipeline; + hset(args: any[], callback?: ResCallbackT): Pipeline; + hset(...args: any[]): Pipeline; + hsetnx(args: any[], callback?: ResCallbackT): Pipeline; + hsetnx(...args: any[]): Pipeline; + hget(args: any[], callback?: ResCallbackT): Pipeline; + hget(...args: any[]): Pipeline; + hmset(args: any[], callback?: ResCallbackT): Pipeline; + hmset(key: string, hash: any, callback?: ResCallbackT): Pipeline; + hmset(...args: any[]): Pipeline; + hmget(args: any[], callback?: ResCallbackT): Pipeline; + hmget(...args: any[]): Pipeline; + hincrby(args: any[], callback?: ResCallbackT): Pipeline; + hincrby(...args: any[]): Pipeline; + hdel(args: any[], callback?: ResCallbackT): Pipeline; + hdel(...args: any[]): Pipeline; + hlen(args: any[], callback?: ResCallbackT): Pipeline; + hlen(...args: any[]): Pipeline; + hkeys(args: any[], callback?: ResCallbackT): Pipeline; + hkeys(...args: any[]): Pipeline; + hvals(args: any[], callback?: ResCallbackT): Pipeline; + hvals(...args: any[]): Pipeline; + hgetall(args: any[], callback?: ResCallbackT): Pipeline; + hgetall(...args: any[]): Pipeline; + hgetall(key: string, callback?: ResCallbackT): Pipeline; + hexists(args: any[], callback?: ResCallbackT): Pipeline; + hexists(...args: any[]): Pipeline; + incrby(args: any[], callback?: ResCallbackT): Pipeline; + incrby(...args: any[]): Pipeline; + decrby(args: any[], callback?: ResCallbackT): Pipeline; + decrby(...args: any[]): Pipeline; + getset(args: any[], callback?: ResCallbackT): Pipeline; + getset(...args: any[]): Pipeline; + mset(args: any[], callback?: ResCallbackT): Pipeline; + mset(...args: any[]): Pipeline; + msetnx(args: any[], callback?: ResCallbackT): Pipeline; + msetnx(...args: any[]): Pipeline; + randomkey(args: any[], callback?: ResCallbackT): Pipeline; + randomkey(...args: any[]): Pipeline; + select(args: any[], callback?: ResCallbackT): void; + select(...args: any[]): Pipeline; + move(args: any[], callback?: ResCallbackT): Pipeline; + move(...args: any[]): Pipeline; + rename(args: any[], callback?: ResCallbackT): Pipeline; + rename(...args: any[]): Pipeline; + renamenx(args: any[], callback?: ResCallbackT): Pipeline; + renamenx(...args: any[]): Pipeline; + expire(args: any[], callback?: ResCallbackT): Pipeline; + expire(...args: any[]): Pipeline; + expireat(args: any[], callback?: ResCallbackT): Pipeline; + expireat(...args: any[]): Pipeline; + keys(args: any[], callback?: ResCallbackT): Pipeline; + keys(...args: any[]): Pipeline; + dbsize(args: any[], callback?: ResCallbackT): Pipeline; + dbsize(...args: any[]): Pipeline; + auth(args: any[], callback?: ResCallbackT): void; + auth(...args: any[]): void; + ping(args: any[], callback?: ResCallbackT): Pipeline; + ping(...args: any[]): Pipeline; + echo(args: any[], callback?: ResCallbackT): Pipeline; + echo(...args: any[]): Pipeline; + save(args: any[], callback?: ResCallbackT): Pipeline; + save(...args: any[]): Pipeline; + bgsave(args: any[], callback?: ResCallbackT): Pipeline; + bgsave(...args: any[]): Pipeline; + bgrewriteaof(args: any[], callback?: ResCallbackT): Pipeline; + bgrewriteaof(...args: any[]): Pipeline; + shutdown(args: any[], callback?: ResCallbackT): Pipeline; + shutdown(...args: any[]): Pipeline; + lastsave(args: any[], callback?: ResCallbackT): Pipeline; + lastsave(...args: any[]): Pipeline; + type(args: any[], callback?: ResCallbackT): Pipeline; + type(...args: any[]): Pipeline; + multi(args: any[], callback?: ResCallbackT): Pipeline; + multi(...args: any[]): Pipeline; + exec(args: any[], callback?: ResCallbackT): Pipeline; + exec(...args: any[]): Pipeline; + discard(args: any[], callback?: ResCallbackT): Pipeline; + discard(...args: any[]): Pipeline; + sync(args: any[], callback?: ResCallbackT): Pipeline; + sync(...args: any[]): Pipeline; + flushdb(args: any[], callback?: ResCallbackT): Pipeline; + flushdb(...args: any[]): Pipeline; + flushall(args: any[], callback?: ResCallbackT): Pipeline; + flushall(...args: any[]): Pipeline; + sort(args: any[], callback?: ResCallbackT): Pipeline; + sort(...args: any[]): Pipeline; + info(args: any[], callback?: ResCallbackT): Pipeline; + info(...args: any[]): Pipeline; + monitor(args: any[], callback?: ResCallbackT): Pipeline; + monitor(...args: any[]): Pipeline; + ttl(args: any[], callback?: ResCallbackT): Pipeline; + ttl(...args: any[]): Pipeline; + persist(args: any[], callback?: ResCallbackT): Pipeline; + persist(...args: any[]): Pipeline; + slaveof(args: any[], callback?: ResCallbackT): Pipeline; + slaveof(...args: any[]): Pipeline; + debug(args: any[], callback?: ResCallbackT): Pipeline; + debug(...args: any[]): Pipeline; + config(args: any[], callback?: ResCallbackT): Pipeline; + config(...args: any[]): Pipeline; + subscribe(args: any[], callback?: ResCallbackT): Pipeline; + subscribe(...args: any[]): Pipeline; + unsubscribe(args: any[], callback?: ResCallbackT): Pipeline; + unsubscribe(...args: any[]): Pipeline; + psubscribe(args: any[], callback?: ResCallbackT): Pipeline; + psubscribe(...args: any[]): Pipeline; + punsubscribe(args: any[], callback?: ResCallbackT): Pipeline; + punsubscribe(...args: any[]): Pipeline; + publish(args: any[], callback?: ResCallbackT): Pipeline; + publish(...args: any[]): Pipeline; + watch(args: any[], callback?: ResCallbackT): Pipeline; + watch(...args: any[]): Pipeline; + unwatch(args: any[], callback?: ResCallbackT): Pipeline; + unwatch(...args: any[]): Pipeline; + cluster(args: any[], callback?: ResCallbackT): Pipeline; + cluster(...args: any[]): Pipeline; + restore(args: any[], callback?: ResCallbackT): Pipeline; + restore(...args: any[]): Pipeline; + migrate(args: any[], callback?: ResCallbackT): Pipeline; + migrate(...args: any[]): Pipeline; + dump(args: any[], callback?: ResCallbackT): Pipeline; + dump(...args: any[]): Pipeline; + object(args: any[], callback?: ResCallbackT): Pipeline; + object(...args: any[]): Pipeline; + client(args: any[], callback?: ResCallbackT): Pipeline; + client(...args: any[]): Pipeline; + eval(args: any[], callback?: ResCallbackT): Pipeline; + eval(...args: any[]): Pipeline; + evalsha(args: any[], callback?: ResCallbackT): Pipeline; + evalsha(...args: any[]): Pipeline; + quit(args: any[], callback?: ResCallbackT): Pipeline; + quit(...args: any[]): Pipeline; + scan(...args: any[]): Pipeline; + scan(args: any[], callback?: ResCallbackT): Pipeline; + hscan(...args: any[]): Pipeline; + hscan(args: any[], callback?: ResCallbackT): Pipeline; + zscan(...args: any[]): Pipeline; + zscan(args: any[], callback?: ResCallbackT): Pipeline; + } + + interface Cluster extends NodeJS.EventEmitter, Commander { + new (nodes: { host: string; port: number; }[], options?: IORedis.ClusterOptions): Redis; + connect(callback: Function): Promise; + disconnect(): void; + nodes(role: string): Redis[]; + } + + interface ResCallbackT { + (err: Error, res: R): void; + } + + interface RedisOptions { + port?: number; + host?: string; + /** + * 4 (IPv4) or 6 (IPv6), Defaults to 4. + */ + family?: number; + /** + * Local domain socket path. If set the port, host and family will be ignored. + */ + path?: string; + /** + * TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive. + */ + keepAlive?: number; + connectionName?: string; + /** + * If set, client will send AUTH command with the value of this option when connected. + */ + password?: string; + /** + * Database index to use. + */ + db?: number; + /** + * When a connection is established to the Redis server, the server might still be loading + * the database from disk. While loading, the server not respond to any commands. + * To work around this, when this option is true, ioredis will check the status of the Redis server, + * and when the Redis server is able to process commands, a ready event will be emitted. + */ + enableReadyCheck?: boolean; + keyPrefix?: string; + retryStrategy?: (times: number) => number; + reconnectOnError?: (error: Error) => boolean; + /** + * By default, if there is no active connection to the Redis server, commands are added to a queue + * and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means + * the Redis server has loaded the database from disk, otherwise means the connection to the Redis + * server has been established). If this option is false, when execute the command when the connection + * isn't ready, an error will be returned. + */ + enableOfflineQueue?: boolean; + /** + * The milliseconds before a timeout occurs during the initial connection to the Redis server. + * default: 10000. + */ + connectTimeout?: number; + /** + * After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. + * default: true. + */ + autoResubscribe?: boolean; + /** + * If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. + * default: true. + */ + autoResendUnfulfilledCommands?: boolean; + lazyConnect?: boolean; + tls?: { + ca: Buffer; + }; + sentinels?: { host: string; port: number; }[]; + name?: string; + /** + * Enable READONLY mode for the connection. Only available for cluster mode. + * default: false. + */ + readOnly?: boolean; + } + + interface ScanStreamOption { + match?: string; + count?: number; + } + + interface ClusterOptions { + clusterRetryStrategy?: (times: number) => number; + enableOfflineQueue?: boolean; + enableReadyCheck?: boolean; + scaleReads?: string; + maxRedirections?: number; + retryDelayOnFailover?: number; + retryDelayOnClusterDown?: number; + retryDelayOnTryAgain?: number; + redisOptions?: RedisOptions; + } +} diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 81f1a1a886..45b2d155a6 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -747,31 +747,31 @@ describe("Manually ticking the Jasmine Clock", function () { describe("Asynchronous specs", function () { var value: number; - beforeEach(function (done) { + beforeEach(function (done: DoneFn) { setTimeout(function () { value = 0; done(); }, 1); }); - it("should support async execution of test preparation and expectations", function (done) { + it("should support async execution of test preparation and expectations", function (done: DoneFn) { value++; expect(value).toBeGreaterThan(0); done(); }); describe("long asynchronous specs", function() { - beforeEach(function(done) { + beforeEach(function(done: DoneFn) { done(); }, 1000); - it("takes a long time", function(done) { + it("takes a long time", function(done: DoneFn) { setTimeout(function() { done(); }, 9000); }, 10000); - afterEach(function(done) { + afterEach(function(done: DoneFn) { done(); }, 1000); }); diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 4fa5a7adef..aa3acdfbf8 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -11,29 +11,36 @@ declare function fdescribe(description: string, specDefinitions: () => void): vo declare function xdescribe(description: string, specDefinitions: () => void): void; declare function it(expectation: string, assertion?: () => void, timeout?: number): void; -declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ declare function pending(reason?: string): void; declare function beforeEach(action: () => void, timeout?: number): void; -declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; +declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; declare function afterEach(action: () => void, timeout?: number): void; -declare function afterEach(action: (done: () => void) => void, timeout?: number): void; +declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; declare function beforeAll(action: () => void, timeout?: number): void; -declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; +declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; declare function afterAll(action: () => void, timeout?: number): void; -declare function afterAll(action: (done: () => void) => void, timeout?: number): void; +declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; declare function expect(spy: Function): jasmine.Matchers; declare function expect(actual: any): jasmine.Matchers; declare function fail(e?: any): void; +/** Action method that should be called when the async work is complete */ +interface DoneFn extends Function { + (): void; + + /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ + fail: (message?: Error|string) => void; +} declare function spyOn(object: any, method: string): jasmine.Spy; diff --git a/js-md5/md5.d.ts b/js-md5/md5.d.ts index 13f0db9354..003793fea3 100644 --- a/js-md5/md5.d.ts +++ b/js-md5/md5.d.ts @@ -29,4 +29,8 @@ interface String { md5(value: Uint8Array): string; } +declare module "js-md5" { + export = md5; +} + declare var md5: md5; diff --git a/json-socket/json-socket-tests.ts b/json-socket/json-socket-tests.ts new file mode 100644 index 0000000000..846fa362a8 --- /dev/null +++ b/json-socket/json-socket-tests.ts @@ -0,0 +1,13 @@ +/// + +import JsonSocket = require("json-socket"); +import {Socket} from "net"; + +JsonSocket.sendSingleMessage(42, "localhost", {foo: "bar"}, (err: Error) => {}); +JsonSocket.sendSingleMessageAndReceive(42, "localhost", {foo: "bar"}, (err: Error, message: any) => {}); + +let jsonSocket = new JsonSocket(new Socket()); +jsonSocket.sendMessage({foo: "bar"}, (err: Error) => {}); +jsonSocket.sendEndMessage({foo: "bar"}, (err: Error) => {}); +jsonSocket.sendError(new Error("foo"), (err: Error) => {}); +jsonSocket.sendEndError(new Error("foo"), (err: Error) => {}); diff --git a/json-socket/json-socket.d.ts b/json-socket/json-socket.d.ts new file mode 100644 index 0000000000..198dbf5f51 --- /dev/null +++ b/json-socket/json-socket.d.ts @@ -0,0 +1,71 @@ +// Type definitions for json-socket v0.1.2 +// Project: https://github.com/sebastianseilund/node-json-socket +// Definitions by: Sven Reglitzki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "json-socket" { + + import {Socket} from "net"; + + class JsonSocket extends Socket { + + constructor(socket: Socket); + + /** + * sends a single message and closes the connection instantly. Use this if you need to send a server a message, + * but you don't need any response. + * @param port port to send the message to + * @param host host to send the message to + * @param message the message to send + * @param callback will be called after the message has been sent + */ + static sendSingleMessage(port: number, host: string, message: any, callback: (err: Error) => void): void; + + /** + * sends a single message, waits for a single response message from the server and closes the connection right after. + * Use this if you need to send a server a message, and get a response, but you don't need the connection to stay + * open. + * @param port port to send the message to + * @param host host to send the message to + * @param message the message to send + * @param callback will be called when the response message has been received + */ + static sendSingleMessageAndReceive(port: number, host: string, message: any, callback: (err: Error, message: any) => void): void; + + /** + * Convenience method for sending an error as a message. + * @param err an Error object that should be formatted as a message + * @param callback will be called after the message has been sent + */ + sendError(err: Error, callback: (err: Error) => void): void; + + /** + * Same as {@link JsonSocket.sendError}, except that the socket is closed right after the message has been sent + * using net.end(). + * No more messages can be sent from either the server or client through this socket. + * @param err + * @param callback + */ + sendEndError(err: Error, callback: (err: Error) => void): void; + + /** + * Sends a JSON message over the socket. + * @param message the message to send + * @param callback will be called after the message has been sent + */ + sendMessage(message: any, callback: (err: Error) => void): void; + + /** + * Same as {@link JsonSocket.sendMessage}, except that the socket is closed right after the message has been sent + * using net.end(). + * No more messages can be sent from either the server or client through this socket. + * @param message the message to send + * @param callback will be called after the message has been sent + */ + sendEndMessage(message: any, callback: (err: Error) => void): void; + } + + export = JsonSocket; +} diff --git a/jsx-chai/jsx-chai-tests.ts b/jsx-chai/jsx-chai-tests.ts new file mode 100644 index 0000000000..be9aeef58d --- /dev/null +++ b/jsx-chai/jsx-chai-tests.ts @@ -0,0 +1,9 @@ +/// +/// + +import chai = require('chai'); +import jsxChai = require('jsx-chai'); + +function testUseJsxChai() { + chai.use(jsxChai.jsxChai); +} diff --git a/jsx-chai/jsx-chai.d.ts b/jsx-chai/jsx-chai.d.ts new file mode 100644 index 0000000000..28782dda59 --- /dev/null +++ b/jsx-chai/jsx-chai.d.ts @@ -0,0 +1,20 @@ +// Type definitions for jsx-chai 3.0.0 +// Project: https://github.com/bkonkle/jsx-chai +// Definitions by: Philipp Holzer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'jsx-chai' { + interface JsxChaiStatic { + jsxChai: jsxChaiFunction; + } + + interface jsxChaiFunction { + (chai: any, utils: any): void; + } + + var jsxChai: JsxChaiStatic; + + export = jsxChai; +} diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 62b6912b81..20b6bf16a2 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -262,8 +262,10 @@ declare namespace kendo { static fn: Observable; static extend(prototype: Object): Observable; + init(...args: any[]): void bind(eventName: string, handler: Function): Observable; one(eventName: string, handler: Function): Observable; + first(eventName: string, handler: Function): Observable; trigger(eventName: string, e?: any): boolean; unbind(eventName: string, handler?: any): Observable; } @@ -1074,6 +1076,31 @@ declare namespace kendo.data { view(): kendo.data.ObservableArray; } + class Query { + data: any[]; + + static process(data: any[], options: DataSourceTransportReadOptionsData): QueryResult; + + constructor(data: any[]); + toArray(): any[]; + range(intex: number, count: number): kendo.data.Query; + skip(count: number): kendo.data.Query; + take(count: number): kendo.data.Query; + select(selector: Function): kendo.data.Query; + order(selector: string, dir?: string): kendo.data.Query; + order(selector: Function, dir?: string): kendo.data.Query; + filter(filters: DataSourceFilterItem): kendo.data.Query; + filter(filters: DataSourceFilterItem[]): kendo.data.Query; + filter(filters: DataSourceFilters): kendo.data.Query; + group(descriptors: DataSourceGroupItem): kendo.data.Query; + group(descriptors: DataSourceGroupItem[]): kendo.data.Query; + } + + interface QueryResult { + total?: number; + data?: any[]; + } + interface DataSourceAggregateItem { field?: string; aggregate?: string; @@ -4209,6 +4236,7 @@ declare namespace kendo.ui { dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; + operators?: any; search?: boolean; ignoreCase?: boolean; ui?: string|Function; @@ -5554,9 +5582,11 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; + adjustSize?: any; animation?: PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; + collision?: string; origin?: string; position?: string; activate?(e: PopupActivateEvent): void; @@ -6677,6 +6707,9 @@ declare namespace kendo.ui { enable(element: string, enable?: boolean): kendo.ui.TabStrip; enable(element: Element, enable?: boolean): kendo.ui.TabStrip; enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; @@ -6686,6 +6719,9 @@ declare namespace kendo.ui { insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; @@ -7213,7 +7249,9 @@ declare namespace kendo.ui { dataItem(row: JQuery): kendo.data.TreeListModel; destroy(): void; editRow(row: JQuery): void; - expand(): void; + expand(row: string): void; + expand(row: Element): void; + expand(row: JQuery): void; itemFor(model: kendo.data.TreeListModel): JQuery; itemFor(model: any): JQuery; items(): any; @@ -7930,6 +7968,7 @@ declare namespace kendo.ui { interface WindowRefreshOptions { url?: string; + cache?: boolean; data?: any; type?: string; template?: string; @@ -7945,6 +7984,7 @@ declare namespace kendo.ui { content?: WindowContent; draggable?: boolean; iframe?: boolean; + height?: number|string; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -7957,7 +7997,6 @@ declare namespace kendo.ui { title?: string|boolean; visible?: boolean; width?: number|string; - height?: number|string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -8107,6 +8146,174 @@ declare namespace kendo.dataviz.ui { } + interface ChartAxisDefaultsCrosshairTooltipBorder { + color?: string; + dashType?: string; + width?: number; + } + + interface ChartAxisDefaultsCrosshairTooltipPadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsCrosshairTooltip { + background?: string; + border?: ChartAxisDefaultsCrosshairTooltipBorder; + color?: string; + font?: string; + format?: string; + padding?: ChartAxisDefaultsCrosshairTooltipPadding; + template?: string|Function; + visible?: boolean; + } + + interface ChartAxisDefaultsCrosshair { + color?: string; + opacity?: number; + tooltip?: ChartAxisDefaultsCrosshairTooltip; + visible?: boolean; + width?: number; + } + + interface ChartAxisDefaultsLabelsMargin { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsLabelsPadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsLabelsRotation { + align?: string; + angle?: number|string; + } + + interface ChartAxisDefaultsLabels { + font?: string; + format?: string; + margin?: ChartAxisDefaultsLabelsMargin; + mirror?: boolean; + padding?: ChartAxisDefaultsLabelsPadding; + rotation?: ChartAxisDefaultsLabelsRotation; + skip?: number; + step?: number; + template?: string|Function; + visible?: boolean; + visual?: Function; + } + + interface ChartAxisDefaultsLine { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + } + + interface ChartAxisDefaultsMajorGridLines { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMajorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMinorGridLines { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMinorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsPlotBand { + color?: string; + from?: number; + opacity?: number; + to?: number; + } + + interface ChartAxisDefaultsTitleBorder { + color?: string; + dashType?: string; + width?: number; + } + + interface ChartAxisDefaultsTitleMargin { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsTitlePadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsTitle { + background?: string; + border?: ChartAxisDefaultsTitleBorder; + color?: string; + font?: string; + margin?: ChartAxisDefaultsTitleMargin; + padding?: ChartAxisDefaultsTitlePadding; + position?: string; + rotation?: number; + text?: string; + visible?: boolean; + visual?: Function; + } + + interface ChartAxisDefaults { + background?: string; + color?: string; + crosshair?: ChartAxisDefaultsCrosshair; + labels?: ChartAxisDefaultsLabels; + line?: ChartAxisDefaultsLine; + majorGridLines?: ChartAxisDefaultsMajorGridLines; + majorTicks?: ChartAxisDefaultsMajorTicks; + minorGridLines?: ChartAxisDefaultsMinorGridLines; + minorTicks?: ChartAxisDefaultsMinorTicks; + narrowRange?: boolean; + pane?: string; + plotBands?: ChartAxisDefaultsPlotBand[]; + reverse?: boolean; + startAngle?: number; + title?: ChartAxisDefaultsTitle; + visible?: boolean; + } + interface ChartCategoryAxisItemAutoBaseUnitSteps { seconds?: any; minutes?: any; @@ -9280,6 +9487,7 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; + opacity?: number; padding?: ChartTooltipPadding; shared?: boolean; sharedTemplate?: string|Function; @@ -10183,7 +10391,7 @@ declare namespace kendo.dataviz.ui { interface ChartOptions { name?: string; autoBind?: boolean; - axisDefaults?: any; + axisDefaults?: ChartAxisDefaults; categoryAxis?: ChartCategoryAxisItem[]; chartArea?: ChartChartArea; dataSource?: any|any|kendo.data.DataSource; @@ -10363,9 +10571,9 @@ declare namespace kendo.dataviz.ui { options: DiagramOptions; dataSource: kendo.data.DataSource; - connections: kendo.dataviz.diagram.Connection[]; + connections: DiagramConnection[]; connectionsDataSource: kendo.data.DataSource; - shapes: kendo.dataviz.diagram.Shape[]; + shapes: DiagramShape[]; element: JQuery; wrapper: JQuery; @@ -10432,6 +10640,9 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -10526,6 +10737,9 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -10776,9 +10990,76 @@ declare namespace kendo.dataviz.ui { stroke?: DiagramSelectableStroke; } + interface DiagramShapeDefaultsConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHover { + fill?: DiagramShapeDefaultsConnectorDefaultsHoverFill; + stroke?: DiagramShapeDefaultsConnectorDefaultsHoverStroke; + } + + interface DiagramShapeDefaultsConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorDefaults { + width?: number; + height?: number; + hover?: DiagramShapeDefaultsConnectorDefaultsHover; + fill?: DiagramShapeDefaultsConnectorDefaultsFill; + stroke?: DiagramShapeDefaultsConnectorDefaultsStroke; + } + + interface DiagramShapeDefaultsConnectorFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorHover { + fill?: DiagramShapeDefaultsConnectorHoverFill; + stroke?: DiagramShapeDefaultsConnectorHoverStroke; + } + + interface DiagramShapeDefaultsConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface DiagramShapeDefaultsConnector { name?: string; position?: Function; + width?: number; + height?: number; + hover?: DiagramShapeDefaultsConnectorHover; + fill?: DiagramShapeDefaultsConnectorFill; + stroke?: DiagramShapeDefaultsConnectorStroke; } interface DiagramShapeDefaultsContent { @@ -10844,6 +11125,7 @@ declare namespace kendo.dataviz.ui { interface DiagramShapeDefaults { connectors?: DiagramShapeDefaultsConnector[]; + connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; editable?: DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; @@ -10863,10 +11145,77 @@ declare namespace kendo.dataviz.ui { y?: number; } + interface DiagramShapeConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorDefaultsHover { + fill?: DiagramShapeConnectorDefaultsHoverFill; + stroke?: DiagramShapeConnectorDefaultsHoverStroke; + } + + interface DiagramShapeConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorDefaults { + width?: number; + height?: number; + hover?: DiagramShapeConnectorDefaultsHover; + fill?: DiagramShapeConnectorDefaultsFill; + stroke?: DiagramShapeConnectorDefaultsStroke; + } + + interface DiagramShapeConnectorFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorHover { + fill?: DiagramShapeConnectorHoverFill; + stroke?: DiagramShapeConnectorHoverStroke; + } + + interface DiagramShapeConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface DiagramShapeConnector { description?: string; name?: string; position?: Function; + width?: number; + height?: number; + hover?: DiagramShapeConnectorHover; + fill?: DiagramShapeConnectorFill; + stroke?: DiagramShapeConnectorStroke; } interface DiagramShapeContent { @@ -10930,6 +11279,7 @@ declare namespace kendo.dataviz.ui { interface DiagramShape { connectors?: DiagramShapeConnector[]; + connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; editable?: DiagramShapeEditable; fill?: DiagramShapeFill; @@ -10999,6 +11349,7 @@ declare namespace kendo.dataviz.ui { remove?(e: DiagramRemoveEvent): void; save?(e: DiagramSaveEvent): void; select?(e: DiagramSelectEvent): void; + toolBarClick?(e: DiagramToolBarClickEvent): void; zoomEnd?(e: DiagramZoomEndEvent): void; zoomStart?(e: DiagramZoomStartEvent): void; } @@ -11091,6 +11442,13 @@ declare namespace kendo.dataviz.ui { deselected?: any; } + interface DiagramToolBarClickEvent extends DiagramEvent { + action?: string; + shapes?: any; + connections?: any; + target?: JQuery; + } + interface DiagramZoomEndEvent extends DiagramEvent { point?: kendo.dataviz.diagram.Point; zoom?: number; @@ -14924,6 +15282,9 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -15022,11 +15383,35 @@ declare namespace kendo.dataviz.diagram { opacity?: number; } + interface ConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface ConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ConnectorHover { + fill?: ConnectorHoverFill; + stroke?: ConnectorHoverStroke; + } + + interface ConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface ConnectorOptions { name?: string; width?: number; height?: number; + hover?: ConnectorHover; fill?: ConnectorFill; + stroke?: ConnectorStroke; } interface ConnectorEvent { sender: Connector; @@ -15491,6 +15876,41 @@ declare namespace kendo.dataviz.diagram { } + interface ShapeConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface ShapeConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface ShapeConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ShapeConnectorDefaultsHover { + fill?: ShapeConnectorDefaultsHoverFill; + stroke?: ShapeConnectorDefaultsHoverStroke; + } + + interface ShapeConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ShapeConnectorDefaults { + width?: number; + height?: number; + hover?: ShapeConnectorDefaultsHover; + fill?: ShapeConnectorDefaultsFill; + stroke?: ShapeConnectorDefaultsStroke; + } + interface ShapeConnector { name?: string; description?: string; @@ -15498,8 +15918,11 @@ declare namespace kendo.dataviz.diagram { } interface ShapeContent { - text?: string; align?: string; + color?: string; + fontFamily?: string; + fontSize?: number; + text?: string; } interface ShapeEditable { @@ -15566,6 +15989,7 @@ declare namespace kendo.dataviz.diagram { content?: ShapeContent; selectable?: boolean; visual?: Function; + connectorDefaults?: ShapeConnectorDefaults; } interface ShapeEvent { sender: Shape; @@ -15859,6 +16283,7 @@ declare namespace kendo.spreadsheet { showGridLines(): boolean; showGridLines(showGridLiens?: boolean): void; toJSON(): void; + setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; unhideColumn(index: number): void; unhideRow(index: number): void; diff --git a/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts index ed5bb29666..a7118d78d3 100644 --- a/kii-cloud-sdk/kii-cloud-sdk-tests.ts +++ b/kii-cloud-sdk/kii-cloud-sdk-tests.ts @@ -21,6 +21,16 @@ function main() { .then(function (user: KiiUser) { }); + user.pushInstallation().getMqttEndpoint("") + .then(function (endpoint: KiiCloud.KiiMqttEndpoint) { + endpoint.installationID; + }); + + var anotherUser: KiiUser = KiiUserBuilder + .builderWithIdentifier("id", "password") + .setEmailAddress("mail@example.org") + .build(); + var bucket = Kii.bucketWithName("foo"); var clause1 = KiiClause.lessThan("x", 1); var clause2 = KiiClause.greaterThan("y", 1); diff --git a/kii-cloud-sdk/kii-cloud-sdk.d.ts b/kii-cloud-sdk/kii-cloud-sdk.d.ts index 22dccac706..970061e8d1 100644 --- a/kii-cloud-sdk/kii-cloud-sdk.d.ts +++ b/kii-cloud-sdk/kii-cloud-sdk.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kii Cloud SDK v2.4.0 +// Type definitions for Kii Cloud SDK v2.4.3 // Project: http://en.kii.com/ // Definitions by: Kii Consortium // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -166,6 +166,33 @@ declare namespace KiiCloud { username?: string; } + interface KiiAccessTokenObject { + access_token: string; + expires_at: Date; + } + + interface KiiGcmInstallationResponse { + installationID: string; + } + + interface KiiMqttInstallationResponse { + installationID: string; + installationRegistrationID: string; + } + + interface KiiMqttEndpoint { + installationID: string; + username: string; + password: string; + mqttTopic: string; + host: string; + "X-MQTT-TTL": number; + portTCP: number; + portSSL: number; + portWS: number; + portWSS: number; + } + /** * The main SDK class */ @@ -623,6 +650,7 @@ declare namespace KiiCloud { * KiiACLAction.KiiACLBucketActionCreateObjects,
* KiiACLAction.KiiACLBucketActionQueryObjects,
* KiiACLAction.KiiACLBucketActionDropBucket,
+ * KiiACLAction.KiiACLBucketActionReadObjects,
* KiiACLAction.KiiACLObjectActionRead,
* KiiACLAction.KiiACLObjectActionWrite,
* KiiACLAction.KiiACLSubscribeToTopic,
@@ -1998,7 +2026,7 @@ declare namespace KiiCloud { * @example * // example to use callbacks directly * var bucket = . . .; // a KiiBucket - * bucket['delete']({ + * bucket.delete({ * success: function(deletedBucket) { * // do something with the result * }, @@ -2010,7 +2038,7 @@ declare namespace KiiCloud { * * // example to use Promise * var bucket = . . .; // a KiiBucket - * bucket['delete']({ + * bucket.delete({ * success: function(deletedBucket) { * // do something with the result * }, @@ -2394,7 +2422,7 @@ declare namespace KiiCloud { * *
  • reject callback function: function(error). error is an Error instance. *
      - *
    • error.target is the KiiACL instance which this method was called on.
    • + *
    • error.target is the KiiGroup instance which this method was called on.
    • *
    • error.message
    • *
    *
  • @@ -2512,15 +2540,7 @@ declare namespace KiiCloud { * * // example to use Promise * var group = . . .; // a KiiGroup - * group.save({ - * success: function(theSavedGroup) { - * // do something with the saved group - * }, - * - * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { - * // do something with the error response - * } - * }).then( + * group.save().then( * function(theSavedGroup) { * // do something with the saved group * }, @@ -2571,15 +2591,7 @@ declare namespace KiiCloud { * * // example to use Promise * var group = . . .; // a KiiGroup - * group.saveWithOwner("UserID of owner", { - * success: function(theSavedGroup) { - * // do something with the saved group - * }, - * - * failure: function(theGroup, anErrorString, addMembersArray, removeMembersArray) { - * // do something with the error response - * } - * }).then( + * group.saveWithOwner("UserID of owner").then( * function(theSavedGroup) { * // do something with the saved group * }, @@ -2656,7 +2668,7 @@ declare namespace KiiCloud { * @example * // example to use callbacks directly * var group = . . .; // a KiiGroup - * group['delete']({ + * group.delete({ * success: function(theDeletedGroup) { * // do something * }, @@ -2668,7 +2680,7 @@ declare namespace KiiCloud { * * // example to use Promise * var group = . . .; // a KiiGroup - * group['delete']({ + * group.delete({ * success: function(theDeletedGroup) { * }, * @@ -2891,6 +2903,13 @@ declare namespace KiiCloud { */ getUUID(): string; + /** + * Get Id of the object or null if the object ID hasn't been assigned. + * + * @return + */ + getID(): string; + /** * Get the server's creation date of this object * @@ -3179,7 +3198,7 @@ declare namespace KiiCloud { * @example * // example to use callbacks directly * var obj = . . .; // a KiiObject - * obj['delete']({ + * obj.delete({ * success: function(theDeletedObject) { * // do something * }, @@ -3191,7 +3210,7 @@ declare namespace KiiCloud { * * // example to use Promise * var obj = . . .; // a KiiObject - * obj['delete']().then( + * obj.delete().then( * function(theDeletedObject) { * // do something * }, @@ -3419,7 +3438,7 @@ declare namespace KiiCloud { * // Obtaind body contents as bodyBlob. * // content-type managed in Kii Cloud can be obtained from type attr. * // It is same as obj.getBodyContentType(); - * var obj = param[0]; + * var obj = params[0]; * var bodyBlob = params[1]; * var contentType = bodyBlob.type; * }, @@ -3651,6 +3670,144 @@ declare namespace KiiCloud { static isValidObjectID(objectID: string): boolean; } + /** + * Represents a KiiPushInstallation object + */ + export class KiiPushInstallation { + /** + * Register the id issued by GCM to the Kii cloud for current logged in user. + * + * @param installationRegistrationID The ID of registration that identifies the installation externally. + * @param development Indicates if the installation is for development or production environment. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(response). + *
        + *
      • response.installationID is ID of the installation in the platform.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * + */ + installGcm(installationRegistrationID: string, development: boolean, callbacks?: { success(response: KiiGcmInstallationResponse): any; failure(error: Error): any; }): Promise; + + /** + * Register a MQTT installation to the Kii cloud for current logged in user. + * + * @param development Indicates if the installation is for development or production environment. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(response). + *
        + *
      • response.installationID is ID of the installation in the platform.
      • + *
      • response.installationRegistrationID is ID of registration that identifies the installation externally.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * + */ + installMqtt(development: boolean, callbacks?: { success(response: KiiMqttInstallationResponse): any; failure(error: Error): any; }): Promise; + + /** + * Get MQTT endpoint. + * If the MQTT endpoint is not ready, this method retries request up to three times. + *

    + * Note that only MQTT over tls is supported currently.
    + * Don't use portSSL, portWS or portWSS until we support it. + * + * @param installationID The ID of the installation in the platform. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function(response). + *
        + *
      • response.installationID is ID of the installation in the platform.
      • + *
      • response.username is username to use for connecting to the MQTT broker.
      • + *
      • response.password is assword to use for connecting to the MQTT broker.
      • + *
      • response.mqttTopic is topic to subscribe in the MQTT broker.
      • + *
      • response.host is URL of the MQTT broker host to connect.
      • + *
      • response.X-MQTT-TTL is the amount of time in seconds that specifies how long the mqttTopic will be valid, after that the client needs to request new MQTT endpoint info.
      • + *
      • response.portTCP is port to connect using plain TCP.
      • + *
      • response.portSSL is port to connect using SSL/TLS.
      • + *
      • response.portWS is port to connect using plain Websocket.
      • + *
      • response.portWSS is port to connect using SSL/TLS Websocket.
      • + *
      + *
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * + */ + getMqttEndpoint(installationID: string, callbacks?: { success(response: KiiMqttEndpoint): any; failure(error: Error): any; }): Promise; + + /** + * Unregister the push settings by the id(issued by push provider) that is used for installation. + * + * @param installationRegistrationID The ID of registration that identifies the installation externally. + * @param deviceType The type of the installation, current implementation only supports "ANDROID" and "MQTT". + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function().
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * + */ + uninstall(installationRegistrationID: string, deviceType: string, callbacks?: { success(): any; failure(error: Error): any; }): Promise; + + /** + * Unregister the push settings by the id(issued by KiiCloud) that is used for installation. + * + * @param installationID The ID of the installation issued by KiiCloud. + * @param callbacks An object with callback methods defined + * + * @return return promise object. + *
      + *
    • fulfill callback function: function().
    • + *
    • reject callback function: function(error). error is an Error instance. + *
        + *
      • error.message
      • + *
      + *
    • + *
    + * + * @example + * + */ + uninstallByInstallationID(installationID: string, callbacks?: { success(): any; failure(error: Error): any; }): Promise; + } + /** * Builder of push message */ @@ -5997,7 +6154,7 @@ declare namespace KiiCloud { * * @return Access token and token expires in a object. */ - getAccessTokenObject(): { access_token: string, expires_at: Date }; + getAccessTokenObject(): KiiAccessTokenObject; /** * Get a specifically formatted string referencing the user @@ -7161,7 +7318,7 @@ declare namespace KiiCloud { * @example * // example to use callbacks directly * var user = Kii.getCurrentUser(); // a KiiUser - * user['delete']({ + * user.delete({ * success: function(theDeletedUser) { * // do something * }, @@ -7173,7 +7330,7 @@ declare namespace KiiCloud { * * // example to use Promise * var user = Kii.getCurrentUser(); // a KiiUser - * user['delete']().then( + * user.delete().then( * function(theDeletedUser) { * // do something * }, @@ -7430,6 +7587,184 @@ declare namespace KiiCloud { * @return push subscription object. */ pushSubscription(): KiiPushSubscription; + + /** + * Instantiate push installation for this user. + * + * @return push installation object. + */ + pushInstallation(): KiiPushInstallation; + } + + /** + * Represents a KiiUser builder + */ + export class KiiUserBuilder { + /** + * Create a KiiUser builder with identifier. + * + *

    Create a KiiUser builder. This constructor is received + * identifier. The identifier is one of user name, email address or + * phone number. This constructor automatically identity What is + * identifier and build proper KiiUser object on build method. + * + *

    Some strings can be accepted as both user name and phone + * number. If such string is passed to this constructor as + * identifier, then phone number is prior to user name. String of + * email address is in different class against user name and phone + * number. So Email address is always identified correctly. + * + * @param identifier The user's user name, email address or phone + * number. Must be string. Must not be null or undefined. + * @param password for the user. Must be string. Must not be null or + * undefined. + * + * @return KiiUser object builder. + * + * @throws If Identifier is not user name, + * email address or phone number. + * @throws If the password is not in the + * proper format + */ + static builderWithIdentifier(identifier: string, password: string): KiiUserBuilder; + + /** + * Create KiiUser builder with email address + * + *

    Create a KiiUser builder with email address. + * + * @param emailAddress email address. + * @param password for the user. Must be string. Must not be null or + * undefined. + * + * @return KiiUser object builder. + * + * @throws If the email address is not in the proper format + * @throws If the password is not in the + * proper format + */ + static builderWithEmailAddress(emailAddress: string, password: string): KiiUserBuilder; + + /** + * Create KiiUser builder with global phone number + * + *

    Create a KiiUser builder with global phone number. + * + * @param phoneNumber global phone number. + * @param password + * + * @return KiiUser object builder. + * + * @throws If the phone number is not in the proper format + */ + static builderWithGlobalPhoneNumber(phoneNumber: string, password: string): KiiUserBuilder; + + /** + * Create KiiUser builder with local phone number + * + *

    Create a KiiUser builder with local phone number. + * + * @param phoneNumber local phone number. + * @param country country code + * @param password for the user. Must be string. Must not be null or + * undefined. + * + * @return KiiUser object builder. + * + * @throws If the phone number is not in the proper format + * @throws If the country code is not a valid format + * @throws If the password is not in the + * proper format + */ + static builderWithLocalPhoneNumber(phoneNumber: string, country: string, password: string): KiiUserBuilder; + + /** + * Create KiiUser builder with user name + * + *

    Create a KiiUser builder with user name. + * + * @param username user name. + * @param password for the user. Must be string. Must not be null or + * undefined. + * + * @return KiiUser object builder. + * + * @throws If the username is not in the proper format + * @throws If the password is not in the + * proper format + */ + static builderWithUsername(username: string, password: string): KiiUserBuilder; + + /** + * Set user name. + * + *

    Set user name. If null or undefined is passed. It is + * ignored. Previous user name is remained. + * + * @param username user name. + * + * @return this builder object. + * + * @throws If the username is not in the + * proper format + */ + setUsername(username: string): KiiUserBuilder; + + /** + * Set email address. + * + *

    Set email address. If null or undefined is passed. It is + * ignored. Previous email address is remained. + * + * @param emailAddress email address. + * + * @return this builder object. + * + * @throws If the email address is not in the + * proper format + */ + setEmailAddress(emailAddress: string): KiiUserBuilder; + + /** + * Set global phone number. + * + *

    Set global phone number. If null or undefined is + * passed. It is ignored. Previous phone number is remained. + * + * @param phoneNumber global phone number. + * + * @return this builder object. + * + * @throws If the phone number is not + * in the proper format + */ + setGlobalPhoneNumber(phoneNumber: string): KiiUserBuilder; + + /** + * Set local phone number. + * + *

    Set local phone number. If null or undefined is + * passed. It is ignored. Previous phone number is remained. + * + * @param phoneNumber local phone number. + * @param country country code + * + * @return this builder object. + * + * @throws If the phone number is not + * in the proper format + * @throws If the country code is not a valid format + */ + setLocalPhoneNumber(phoneNumber: string, country: string): KiiUserBuilder; + + /** + * Build KiiUser object. + * + *

    Build KiiUser object. This method verify set values. + * + * @return a working KiiUser object. + */ + build(): KiiUser; } } @@ -7449,6 +7784,7 @@ import KiiClause = KiiCloud.KiiClause; import KiiGeoPoint = KiiCloud.KiiGeoPoint; import KiiGroup = KiiCloud.KiiGroup; import KiiObject = KiiCloud.KiiObject; +import KiiPushInstallation = KiiCloud.KiiPushInstallation; import KiiPushMessageBuilder = KiiCloud.KiiPushMessageBuilder; import KiiPushSubscription = KiiCloud.KiiPushSubscription; import KiiQuery = KiiCloud.KiiQuery; @@ -7458,3 +7794,4 @@ import KiiSocialConnect = KiiCloud.KiiSocialConnect; import KiiThing = KiiCloud.KiiThing; import KiiTopic = KiiCloud.KiiTopic; import KiiUser = KiiCloud.KiiUser; +import KiiUserBuilder = KiiCloud.KiiUserBuilder; diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index a308a60f02..40a8a83d4f 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -106,6 +106,10 @@ interface KnockoutValidationGroup { isAnyMessageShown?: () => boolean; } +interface KnockoutValidationLocalizationDictionary { + [key: string]: string; +} + interface KnockoutValidationStatic { init(options?: KnockoutValidationConfiguration, force?: boolean): void; reset(): void; @@ -127,7 +131,9 @@ interface KnockoutValidationStatic { registerExtenders(): void; utils: KnockoutValidationUtils; - localize(msgTranslations: any): void; + localize(msgTranslations: KnockoutValidationLocalizationDictionary): void; + defineLocale(newLocale: string, msgTranslations: KnockoutValidationLocalizationDictionary): KnockoutValidationLocalizationDictionary; + locale(newLocale: string): string; validateObservable(observable: KnockoutObservable): boolean; } diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index d50965022f..962a776333 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -535,6 +535,16 @@ interface KnockoutStatic { }; components: KnockoutComponents; + + ///////////////////////////////// + // options.js + ///////////////////////////////// + + options: { + deferUpdates: boolean, + + useOnlyNativeEvents: boolean + } } interface KnockoutBindingProvider { diff --git a/koa-bodyparser/koa-bodyparser.d.ts b/koa-bodyparser/koa-bodyparser.d.ts index 4168832199..f8e1b25aae 100644 --- a/koa-bodyparser/koa-bodyparser.d.ts +++ b/koa-bodyparser/koa-bodyparser.d.ts @@ -60,5 +60,6 @@ declare module "koa-bodyparser" { onerror?: (err: Error, ctx: Koa.Context) => void; }): { (ctx: Koa.Context, next?: () => any): any }; + namespace bodyParser {} export = bodyParser; } diff --git a/koa-json/koa-json-tests.ts b/koa-json/koa-json-tests.ts new file mode 100644 index 0000000000..d173aa83f8 --- /dev/null +++ b/koa-json/koa-json-tests.ts @@ -0,0 +1,15 @@ +/// +/// + +import * as Koa from "koa"; +import * as json from 'koa-json'; + +const app = new Koa(); + +app.use(json({ + pretty: false, + param: 'pretty', + spaces: 2 +})); + +app.listen(80) \ No newline at end of file diff --git a/koa-json/koa-json.d.ts b/koa-json/koa-json.d.ts new file mode 100644 index 0000000000..24c87a8100 --- /dev/null +++ b/koa-json/koa-json.d.ts @@ -0,0 +1,40 @@ +// Type definitions for koa-json v2.x +// Project: https://github.com/koajs/json +// Definitions by: Alex Friedman +// Definitions: https://github.com/brooklyndev/DefinitelyTyped + +/* =================== USAGE =================== + + import * as Koa from 'koa'; + import * as json from 'koa-json'; + + const app = new Koa(); + app.use(json()); + + =============================================== */ +/// + +declare module "koa-json" { + + import * as Koa from "koa"; + + function json(opts?:{ + + /** + * default to pretty response [true] + */ + pretty?: boolean, + + /** + * optional query-string param for pretty responses [none] + */ + param?: string, + + /** + * JSON spaces [2] + */ + spaces?: number + }) : { (ctx: Koa.Context, next?: () => any): any } ; + namespace json {} + export = json; +} \ No newline at end of file diff --git a/latinize/latinize-tests.ts b/latinize/latinize-tests.ts new file mode 100644 index 0000000000..d397458d82 --- /dev/null +++ b/latinize/latinize-tests.ts @@ -0,0 +1,7 @@ +/// + +import latinize = require('latinize'); + +latinize('ỆᶍǍᶆṔƚÉ áéíóúýčďěňřšťžů'); // => 'ExAmPlE aeiouycdenrstzu' + +latinize.characters['Ω'] = 'O'; diff --git a/latinize/latinize.d.ts b/latinize/latinize.d.ts new file mode 100644 index 0000000000..129a7a5aec --- /dev/null +++ b/latinize/latinize.d.ts @@ -0,0 +1,17 @@ +// Type definitions for latinize 0.2.0 +// Project: https://github.com/dundalek/latinize +// Definitions by: Giedrius Grabauskas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace LatinizeModule { + export interface Latinize { + (str: string): string; + characters: { [char: string]: string }; + } +} + + +declare module "latinize" { + let latinize: LatinizeModule.Latinize; + export = latinize; +} diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 6c487c3ebe..37abb90fb1 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3383,6 +3383,11 @@ declare namespace L { */ className?: string; + /** + * Sets the radius of a circle marker. + */ + radius?: number; + } } diff --git a/loglevel/loglevel-tests.ts b/loglevel/loglevel-tests.ts index ab19939569..ca1ebc1664 100644 --- a/loglevel/loglevel-tests.ts +++ b/loglevel/loglevel-tests.ts @@ -16,6 +16,11 @@ log.setLevel("error", false); log.setLevel(LogLevel.WARN); log.setLevel(LogLevel.WARN, false); +log.enableAll(false); +log.enableAll(); +log.disableAll(true); +log.disableAll(); + var logLevel = log.getLevel(); var testLogger = log.getLogger("TestLogger"); @@ -26,3 +31,8 @@ testLogger.warn("logging test"); var logging = log.noConflict(); logging.error("still pretty easy"); + +log.methodFactory = function(methodName: string, level: LogLevel, loggerName :string) { + return function(...messages: any[]) { + }; +}; \ No newline at end of file diff --git a/loglevel/loglevel.d.ts b/loglevel/loglevel.d.ts index 0d8352c652..7ccbe89c33 100644 --- a/loglevel/loglevel.d.ts +++ b/loglevel/loglevel.d.ts @@ -1,6 +1,6 @@ // Type definitions for loglevel 1.4.0 // Project: https://github.com/pimterry/loglevel -// Definitions by: Stefan Profanter , Florian Wagner +// Definitions by: Stefan Profanter , Florian Wagner , Gabor Szmetanko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -15,8 +15,28 @@ declare const enum LogLevel { SILENT = 5 } +interface LoggingMethod { + + (...message : any[]):void; + +} + +interface MethodFactory { + + (methodName : string, level : LogLevel, loggerName : string):LoggingMethod; + +} + interface Log { + /** + * Plugin API entry point. This will be called for each enabled method each time the level is set + * (including initially), and should return a MethodFactory to be used for the given log method, at the given level, + * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's + * recommended that this wraps the initially provided value of log.methodFactory + */ + methodFactory:MethodFactory; + /** * Output trace message to console. * This will also include a full stack trace @@ -135,6 +155,24 @@ interface Log { */ getLogger(name : String):Log; + /** + * This enables all log messages, and is equivalent to log.setLevel("trace"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + enableAll(persist? : boolean):void; + + /** + * This disables all log messages, and is equivalent to log.setLevel("silent"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + disableAll(persist? : boolean):void; + } declare var log : Log; diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 36e43a6e78..bdb7093265 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -576,7 +576,7 @@ declare namespace __MaterialUI { export class EnhancedButton extends React.Component { } - interface FlatButtonProps extends SharedEnhancedButtonProps { + interface FlatButtonProps extends React.DOMAttributes, SharedEnhancedButtonProps { // is the element that get the 'other' properties backgroundColor?: string; disabled?: boolean; @@ -843,7 +843,7 @@ declare namespace __MaterialUI { ref?: string; text: string; } - interface DialogProps extends React.Props { + interface DialogProps extends React.DOMAttributes, React.Props { /** @deprecated use a custom `actions` property instead */ actionFocus?: string; actions?: Array>; diff --git a/microgears/microgears-tests.ts b/microgears/microgears-tests.ts new file mode 100644 index 0000000000..124058de73 --- /dev/null +++ b/microgears/microgears-tests.ts @@ -0,0 +1,58 @@ +/// + + +function verify_module_file() { + var tracePlugin = new TracePlugin(); + microgears.addPlugin(tracePlugin); + var service = new UserService(); + var userService = microgears.addService(service); + + +} + +class TracePlugin implements microgears.Plugin { + name: 'TracePlugin'; + public beforeChain(args:Array, _meta: microgears.MetaInformation) { + var serviceName = _meta.serviceName, + method = _meta.methodName; + console.log('before call-> ' + serviceName + '.' + method); + + _meta.extra = { + count: 1 + }; + + return args + } + public afterChain(result:any, _meta: microgears.MetaInformation) { + var serviceName = _meta.serviceName, + method = _meta.methodName; + + console.log('after of-> ' + serviceName + '.' + method); + if (_meta.extra.count) { + console.log('this number comes to the beforeChain: ' + _meta.extra.count); + } + + return result; + } +} + +class User { + name: string; + email: string; + + constructor(name: string, email: string) { + this.email = email; + this.name = name; + } +} + +class UserService implements microgears.Service { + name: string = "userService"; + namespace: string = "services.user"; + + public findUserById(id: number) { + return new User('test', 'test@example.com'); + } + +} + diff --git a/microgears/microgears.d.ts b/microgears/microgears.d.ts new file mode 100644 index 0000000000..47e19b4e31 --- /dev/null +++ b/microgears/microgears.d.ts @@ -0,0 +1,33 @@ +// Type definitions for microgears v4.0.0 +// Project: http://github.com/marcusdb/microgears +// Definitions by: Marcus David Bronstein +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace microgears { + export interface Service { + name: string; + async?: boolean; + pathname?: string; + namespace: string; + } + + interface MetaInformation { + serviceName: string; + methodName: string; + serviceNameSpace: string; + extra: any; + } + + interface Plugin { + name: string; + beforeChain(arguments: Array, metaInfo: MetaInformation): Array; + afterChain(result: T, metaInfo: MetaInformation): T; + } + + function addService(service: Service): Service; + function addPlugin(plugin: Plugin): void; +} + +declare module "microgears" { + export = microgears; +} \ No newline at end of file diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 5199a64a27..d0880ef1f9 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -686,3 +686,8 @@ declare module 'moment' { var moment: moment.MomentStatic; export = moment; } + +declare module 'moment/moment' { + var moment: moment.MomentStatic; + export = moment; +} diff --git a/mssql/mssql.d.ts b/mssql/mssql.d.ts index 500be24b86..166c3b80ac 100644 --- a/mssql/mssql.d.ts +++ b/mssql/mssql.d.ts @@ -1,6 +1,6 @@ -// Type definitions for mssql v2.2.0 +// Type definitions for mssql v3.1.0 // Project: https://www.npmjs.com/package/mssql -// Definitions by: COLSA Corporation , Ben Farr +// Definitions by: COLSA Corporation , Ben Farr , Vitor Buzinaro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -199,14 +199,14 @@ declare module "mssql" { public constructor(transaction: Transaction); public constructor(preparedStatement: PreparedStatement); public execute(procedure: string): Promise; - public execute(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any) => void): void; + public execute(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any, rowsAffected?: number) => void): void; public input(name: string, value: any): void; public input(name: string, type: any, value: any): void; public output(name: string, type: any, value?: any): void; public pipe(stream: NodeJS.WritableStream): void; public query(command: string): Promise; public query(command: string): Promise; - public query(command: string, callback: (err?: any, recordset?: any) => void): void; + public query(command: string, callback: (err?: any, recordset?: any, rowsAffected?: number) => void): void; public query(command: string, callback: (err?: any, recordset?: Entity[]) => void): void; public batch(batch: string): Promise; public batch(batch: string): Promise; @@ -258,7 +258,7 @@ declare module "mssql" { public prepare(statement?: string, callback?: (err?: any) => void): void; public execute(values: Object): Promise; public execute(values: Object): Promise; - public execute(values: Object, callback: (err: any, recordSet: recordSet) => void): void; + public execute(values: Object, callback: (err: any, recordSet: recordSet, rowsAffected: number) => void): void; public execute(values: Object, callback: (err: any, recordSet: Entity[]) => void): void; public unprepare(): Promise; public unprepare(callback: (err?: any) => void): void; diff --git a/ngstorage/ngstorage-tests.ts b/ngstorage/ngstorage-tests.ts index 2a25697b51..698723eaa3 100644 --- a/ngstorage/ngstorage-tests.ts +++ b/ngstorage/ngstorage-tests.ts @@ -3,7 +3,7 @@ var app: any; -app.controller('MainCtrl', function ($localStorage: angular.storage.ILocalStorageService) { +app.controller('LocalCtrl', function ($localStorage: angular.storage.IStorageService) { $localStorage.set('MyKey', 'value'); @@ -16,12 +16,32 @@ app.controller('MainCtrl', function ($localStorage: angular.storage.ILocalStorag $localStorage.$reset({ counter: 1 }); + + $localStorage.$reset(); $localStorage.$apply(); }); -app.config(['$localStorageProvider', - function ($localStorageProvider: angular.storage.ILocalStorageProvider) { +app.controller('SessionCtrl', function ($sessionStorage: angular.storage.IStorageService) { + + $sessionStorage.set('MyKey', 'value'); + + $sessionStorage.get('MyKey'); + + $sessionStorage.$default({ + counter: 1 + }); + + $sessionStorage.$reset({ + counter: 1 + }); + + $sessionStorage.$reset(); + + $sessionStorage.$apply(); +}); + +app.config(['$localStorageProvider', function ($localStorageProvider: angular.storage.IStorageProvider) { $localStorageProvider.setKeyPrefix('NewPrefix'); $localStorageProvider.get('MyKey'); @@ -39,4 +59,23 @@ app.config(['$localStorageProvider', $localStorageProvider.setSerializer(mySerializer); $localStorageProvider.setDeserializer(myDeserializer); } +]).config(['$sessionStorageProvider', function ($sessionStorageProvider: angular.storage.IStorageProvider) { + + $sessionStorageProvider.setKeyPrefix('NewPrefix'); + + $sessionStorageProvider.get('MyKey'); + + $sessionStorageProvider.set('MyKey', { counter: 'value' }); + + var mySerializer = function (value:any):string { + return value.toString(); + }; + + var myDeserializer = function (value:string):any { + return value; + }; + + $sessionStorageProvider.setSerializer(mySerializer); + $sessionStorageProvider.setDeserializer(myDeserializer); + } ]); diff --git a/ngstorage/ngstorage.d.ts b/ngstorage/ngstorage.d.ts index df72725ced..0ea372ccb8 100644 --- a/ngstorage/ngstorage.d.ts +++ b/ngstorage/ngstorage.d.ts @@ -7,22 +7,22 @@ declare namespace angular.storage { - export interface ILocalStorageService { - $default(items: any):ILocalStorageService; - $reset(items: any):ILocalStorageService; - $apply():void; + export interface IStorageService { + $default(items: {}): IStorageService; + $reset(items?: {}): IStorageService; + $apply(): void; get(key: string): T; set(key: string, value: T): T; } - export interface ILocalStorageProvider extends angular.IServiceProvider { + export interface IStorageProvider extends angular.IServiceProvider { get(key:string): T; set(key:string, value:T): T; - setKeyPrefix(prefix: string):void; - setSerializer(serializer: (value: any)=>string):void; - setDeserializer(deserializer: (value: string)=>any):void; + setKeyPrefix(prefix: string): void; + setSerializer(serializer: (value: any)=>string): void; + setDeserializer(deserializer: (value: string)=>any): void; } } diff --git a/node/node-tests.ts b/node/node-tests.ts index 66c4256caf..0cc0b5de6c 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -138,6 +138,7 @@ function bufferTests() { var base64Buffer = new Buffer('','base64'); var octets: Uint8Array = null; var octetBuffer = new Buffer(octets); + var sharedBuffer = new Buffer(octets.buffer); var copiedBuffer = new Buffer(utf8Buffer); console.log(Buffer.isBuffer(octetBuffer)); console.log(Buffer.isEncoding('utf8')); @@ -181,6 +182,12 @@ function bufferTests() { let sb = new ImportedSlowBuffer(43); b.writeUInt8(0, 6); } + + // Buffer has Uint8Array's buffer field (an ArrayBuffer). + { + let buffer = new Buffer('123'); + let octets = new Uint8Array(buffer.buffer); + } } diff --git a/node/node.d.ts b/node/node.d.ts index 66e9a935f7..1b2da31c94 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -108,6 +108,14 @@ declare var Buffer: { * @param array The octets to store. */ new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + new (arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * @@ -382,12 +390,10 @@ declare namespace NodeJS { /** * @deprecated */ -interface NodeBuffer { - [index: number]: number; +interface NodeBuffer extends Uint8Array { write(string: string, offset?: number, length?: number, encoding?: string): number; toString(encoding?: string, start?: number, end?: number): string; toJSON(): any; - length: number; equals(otherBuffer: Buffer): boolean; compare(otherBuffer: Buffer): number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; @@ -429,7 +435,12 @@ interface NodeBuffer { writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; fill(value: any, offset?: number, end?: number): Buffer; + // TODO: encoding param indexOf(value: string | number | Buffer, byteOffset?: number): number; + // TODO: entries + // TODO: includes + // TODO: keys + // TODO: values } /************************************************ diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index 14fb8717f8..b3bd58c727 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -174,3 +174,7 @@ declare namespace noUiSlider { noUiSlider: noUiSlider } } + +declare module "nouislider" { + export = noUiSlider; +} diff --git a/office-js/office-js.d.ts b/office-js/office-js.d.ts index ff4065fa17..6761ab646c 100644 --- a/office-js/office-js.d.ts +++ b/office-js/office-js.d.ts @@ -2142,7 +2142,7 @@ declare namespace Excel { * * @param across Set true to merge cells in each row of the specified range as separate merged cells. The default value is false. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ merge(across?: boolean): void; /** @@ -2156,7 +2156,7 @@ declare namespace Excel { * * Unmerge the range cells into separate cells. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ unmerge(): void; /** @@ -2473,14 +2473,14 @@ declare namespace Excel { * * Clears all the filters currently applied on the table. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ clearFilters(): void; /** * * Converts the table into a normal range of cells. All data is preserved. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ convertToRange(): Excel.Range; /** @@ -2522,7 +2522,7 @@ declare namespace Excel { * * Reapplies all the filters currently on the table. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ reapplyFilters(): void; /** @@ -2835,14 +2835,14 @@ declare namespace Excel { * * Changes the width of the columns of the current range to achieve the best fit, based on the current data in the columns. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ autofitColumns(): void; /** * * Changes the height of the rows of the current range to achieve the best fit, based on the current data in the columns. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ autofitRows(): void; /** @@ -3221,7 +3221,7 @@ declare namespace Excel { * @param width (Optional) The desired width of the resulting image. * @param fittingMode (Optional) The method used to scale the chart to the specified to the specified dimensions (if both height and width are set)." * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ getImage(width?: number, height?: number, fittingMode?: string): OfficeExtension.ClientResult; /** diff --git a/pathjs/pathjs.d.ts b/pathjs/pathjs.d.ts index dd81115df7..6b6193b222 100644 --- a/pathjs/pathjs.d.ts +++ b/pathjs/pathjs.d.ts @@ -35,7 +35,7 @@ interface IPath { root(path: string): void; - rescure(fn: Function): void; + rescue(fn: Function): void; history: IPathHistory; @@ -50,4 +50,4 @@ interface IPath { routes: IPathRoutes } -declare var Path: IPath; \ No newline at end of file +declare var Path: IPath; diff --git a/pg-promise/pg-promise-tests.ts b/pg-promise/pg-promise-tests.ts deleted file mode 100644 index dcfcea6c9e..0000000000 --- a/pg-promise/pg-promise-tests.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// - -import * as pgpromise from "pg-promise"; - -let db: pgpromise.PromiseClient; -let pgp: pgpromise.PgPromise; - -db.one('sql', { 'values': 'values' }); -db.oneOrNone('sql', { 'values': 'values' }); -db.many('sql', { 'values': 'values' }); -db.many('sql', { 'values': 'values' }, { 'optional': 'optional' }); - -// All functions -db.none('sql'); -db.one('sql'); -db.many('sql'); -db.query('sql'); - - -db.any('sql'); -db.oneOrNone('sql'); -db.manyOrNone('sql'); - -db.func('sql'); -db.proc('sql'); - -db.task(() => {}); -db.tx(() => {}); - -// Optional values -db.none('sql', { 'values': 'values' }); - -// QRM parameter -db.none('sql', { 'values': 'values' }, { 'QRM': 'QRM' }); diff --git a/pg-promise/pg-promise-tests.ts.tscparams b/pg-promise/pg-promise-tests.ts.tscparams deleted file mode 100644 index 14fce22a5c..0000000000 --- a/pg-promise/pg-promise-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ ---target ES6 diff --git a/pg-promise/pg-promise.d.ts b/pg-promise/pg-promise.d.ts index db96344b4d..978b31c934 100644 --- a/pg-promise/pg-promise.d.ts +++ b/pg-promise/pg-promise.d.ts @@ -1,80 +1,7 @@ // Type definitions for pg-promise // Project: https://github.com/vitaly-t/pg-promise -// Definitions by: Jörg Dotzki +// Definitions by: vvakame // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// tsc --noImplicitAny --module commonjs --target ES6 pg-promise/pg-promise-tests.ts - -/// - - -declare namespace PgPromise { -} - - -declare module "pg-promise" { - - import * as pg from "pg"; - - function e(options?: { - - pgFormatting?: Object; - promiseLib?: Object; - connect?: Function; - disconnect?: Function; - query?: Function; - task?: Function; - transact?: Function; - error?: Function; - extend?: Function; - noLocking?: Function; - }): e.PgPromise; - - - - namespace e { - - export interface PromiseClient { - - none(queryText: string, values?: any[] | any, qrm?: any): Promise; - one(queryText: string, values?: any[] | any, qrm?: any): Promise; - many(queryText: string, values?: any[] | any, qrm?: any): Promise; - query(queryText: string, values?: any[] | any, qrm?: any): Promise; - - - any(queryText: string, values?: any[] | any, qrm?: any): Promise; - oneOrNone(queryText: string, values?: any[] | any, qrm?: any): Promise; - manyOrNone(queryText: string, values?: any[] | any, qrm?: any): Promise; - - func(queryText: string, values?: any[] | any, qrm?: any): Promise; - proc(queryText: string, values?: any[] | any): Promise; - - task(func: Function): Promise; - tx(func: Function): Promise; - } - - export interface PgPromise { - connect(callback?: (err: Error) => void): void; - end(): void; - (connectionString: string): PromiseClient; - - as: convert; - } - - export interface convert { - - bool(value: any): boolean; - number(value: any): number; - text(value: any, raw: any): string; - name(value: any): string; - date(value: any, raw: any): string; - json(value: any, raw: any): string; - array(value: any): Array; - csv(value: any): string; - func(func: Function, raw: any, obj: any): Function; - format(query: string, values: any): any; - } - } - - export = e; -} +// deprecated. see https://github.com/vitaly-t/pg-promise/tree/master/typescript +// NOTE https://github.com/DefinitelyTyped/DefinitelyTyped/issues/8956 diff --git a/promise-pg/promise-pg-tests.ts b/promise-pg/promise-pg-tests.ts new file mode 100644 index 0000000000..6a2e74a6fd --- /dev/null +++ b/promise-pg/promise-pg-tests.ts @@ -0,0 +1,95 @@ +/// +/// + +import * as pg from 'promise-pg'; + +var conString = "postgres://username:password@localhost/database"; + +// https://github.com/brianc/node-pg-types +pg.raw.types.setTypeParser(20, (val) => Number(val)); + +// Client pooling +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + client.query("SELECT $1::int AS number", ["1"]).promise + .then(function (result) { + // done + }, function (err) { + console.error("Error running query", err); + }) + .finally(done); + }, function (err) { + return console.error("Error fetching client from pool", err); + }).done(); + +// Simple +var client = new pg.Client(conString); +client.connect() + .spread(function (client: pg.Client, done: () => void) { + client.query("SELECT NOW() AS 'theTime'").promise + .then(function (result) { + console.log(result.rows[0]["theTime"]); + client.end(); + return null; + }, function (err) { + return console.error("Error running query", err); + }); + }, function (err) { + return console.error("Could not connect to postgres", err); + }).done(); + +// Using buffer query option +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + client.query({ + text: "SELECT * FROM users", + buffer: true + }).promise.then( + function (result) { console.log(result.rows.length + " rows returned"); }, + function (err) { console.error("Error running query", err); throw err; }, + function (user: any) {} // called for each returned row + ).finally(done); + }).done(); + +// Transactions +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + var INSERT = "INSERT INTO users(name, t_birth, country) VALUES ($1, $2, $3)"; + + console.log("Transaction I:"); + var trans = client.transaction(function () { + return Q.all([{ + text: INSERT, + values: ["Jake1", "now()", "Oo"] + }, { + text: INSERT, + values: ["Cake2", null, "Küche"] + }, { + text: INSERT, + values: ["Mike3", "now()", null] + }].map(function (q) { return client.query(q).promise; })); + }).then(function() { + console.log("Good - Committed Transaction I."); + }, function (err) { + console.log("Bad - Rolled back Transaction I.", err); + }); + + trans.finally(function () { + client.transaction(function () { + return Q.all([{ + text: INSERT, + values: ["Jake", "now()", "Oo"] + }, { + text: INSERT, // Bad, name is NOT NULL + values: [null, null, "Küche"] + }, { + text: INSERT, + values: ["Mike", "now()", null] + }].map(function (q) { return client.query(q).promise; })); + }).then(function () { + console.log("Bad - Committed Transaction II."); + }, function (err) { + console.log("Good - Rolled back Transaction II.", err.message); + }).finally(done).done(); + }); + }).done(); diff --git a/promise-pg/promise-pg.d.ts b/promise-pg/promise-pg.d.ts new file mode 100644 index 0000000000..47321bbf61 --- /dev/null +++ b/promise-pg/promise-pg.d.ts @@ -0,0 +1,61 @@ +// Type definitions for promise-pg +// Project: https://bitbucket.org/lplabs/promise-pg +// Definitions by: Chris Charabaruk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module "promise-pg" { + import * as stream from 'stream'; + import * as pg from 'pg'; + + export {pg as raw}; + + export interface ClientConfig extends pg.ClientConfig {} + + export function connect(connection: string): Q.Promise; + export function connect(connection: pg.ClientConfig): Q.Promise; + + export function end(): Q.Promise; + + export interface QueryConfig extends pg.QueryConfig { + buffer?: boolean; + } + + export class Client { + constructor(connection: string); + constructor(config: ClientConfig); + + raw: pg.Client; + + connect(): Q.Promise; + end(): Q.Promise; + + query(queryText: string): Query; + query(config: QueryConfig): Query; + query(queryText: string, values: any[]): Query; + + copyFrom(queryText: string): stream.Writable; + copyTo(queryText: string): stream.Readable; + + pauseDrain(): void; + resumeDrain(): void; + + public on(event: "drain", listener: () => void): Client; + public on(event: "error", listener: (err: Error) => void): Client; + public on(event: "notification", listener: (message: any) => void): Client; + public on(event: "notice", listener: (message: any) => void): Client; + public on(event: string, listener: Function): Client; + + transaction(task: () => Q.Promise): Q.Promise; + } + + export interface QueryResult extends pg.QueryResult {} + export interface ResultBuilder extends pg.ResultBuilder {} + + export class Query extends pg.Query { + promise: Q.Promise; + } +} diff --git a/q/Q.d.ts b/q/Q.d.ts index bd9cdb8ca5..4cb4bfad2e 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -292,6 +292,14 @@ declare namespace Q { * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. */ export function isPending(object: any): boolean; + /** + * If an object is not a promise, it is as "near" as possible. + * If a promise is rejected, it is as "near" as possible too. + * If it’s a fulfilled promise, the fulfillment value is nearer. + * If it’s a deferred promise and the deferred has been resolved, the + * resolution is "nearer". + */ + export function nearer(promise: Promise): T; /** * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. diff --git a/qrcode-generator/qrcode-generator-tests.ts b/qrcode-generator/qrcode-generator-tests.ts new file mode 100644 index 0000000000..5fbddd6e8f --- /dev/null +++ b/qrcode-generator/qrcode-generator-tests.ts @@ -0,0 +1,12 @@ +/// + +import qrcode = require('qrcode-generator'); + +let qr = qrcode(4,'M'); + +qr.addData('some arbitrary data'); +qr.make(); + +let imgHtml = qr.createImageTag(5,5); +let svgHtml = qr.createSvgTag(5,5); +let tableHtml = qr.createTableTag(5,5); \ No newline at end of file diff --git a/qrcode-generator/qrcode-generator.d.ts b/qrcode-generator/qrcode-generator.d.ts new file mode 100644 index 0000000000..b99e1ca510 --- /dev/null +++ b/qrcode-generator/qrcode-generator.d.ts @@ -0,0 +1,18 @@ +// Type definitions for grcode-generator +// Project: https://github.com/kazuhikoarase/qrcode-generator +// Definitions by: Stefan Huber +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface QRCode { + addData(data: string) : void; + make() : void; + + createTableTag(cellSize: number, margin: number) : string; + createSvgTag(cellSize: number, margin: number) : string; + createImageTag(cellSize: number, margin: number) : string; +} + +declare module 'qrcode-generator' { + function qrcode(type: number, errorCorrectionLevel: string) : QRCode; + export = qrcode; +} diff --git a/radium/radium-tests.tsx b/radium/radium-tests.tsx new file mode 100644 index 0000000000..d7ec26ef83 --- /dev/null +++ b/radium/radium-tests.tsx @@ -0,0 +1,17 @@ +/// +/// + +import * as React from "react"; +import * as Radium from 'radium'; + +@Radium +export default class TestComponent extends React.Component { + + render() { + return ( +
    + Test with Radium +
    + ); + } +} diff --git a/radium/radium.d.ts b/radium/radium.d.ts new file mode 100644 index 0000000000..438d07aee4 --- /dev/null +++ b/radium/radium.d.ts @@ -0,0 +1,20 @@ +// Type definitions for radium 0.17.1 +// Project: https://github.com/formidablelabs/radium +// Definitions by: Alex Gorbatchev , Philipp Holzer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'radium' { + import React = require('react'); + + interface ReactComponent { + new (p: P): React.Component; + } + + var Radium: { + >(comp: T): T; + }; + + export = Radium; +} diff --git a/react-intl/react-intl-tests.tsx b/react-intl/react-intl-tests.tsx index c7907214c4..701522447d 100644 --- a/react-intl/react-intl-tests.tsx +++ b/react-intl/react-intl-tests.tsx @@ -26,7 +26,7 @@ FormattedPlural, FormattedDate, FormattedTime } from "react-intl" -import reactIntlEn = require("react-intl/lib/locale-data/en"); +import reactIntlEn = require("react-intl/locale-data/en"); addLocaleData(reactIntlEn); console.log(hasLocaleData("en")); @@ -165,4 +165,4 @@ class TestApp extends React.Component<{}, {}> { export default { TestApp, SomeComponent: injectIntl(SomeComponent) -} \ No newline at end of file +} diff --git a/react-intl/react-intl.d.ts b/react-intl/react-intl.d.ts index c45c57a38a..1a2966f8f5 100644 --- a/react-intl/react-intl.d.ts +++ b/react-intl/react-intl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-intl 2.0.0-beta1 +// Type definitions for react-intl 2.0.0 // Project: http://formatjs.io/react/ // Definitions by: Bruno Grieder , Christian Droulers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -233,7 +233,1167 @@ declare module "react-intl" { export = ReactIntl } -declare module "react-intl/lib/locale-data/en" { +declare module "react-intl/locale-data/af" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/agq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ak" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/am" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ar" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/as" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/asa" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ast" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/az" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bas" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/be" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bem" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bez" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bm" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/br" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/brx" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/bs" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ca" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ce" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/cgg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/chr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ckb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/cs" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/cu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/cy" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/da" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dav" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/de" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dje" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dsb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dua" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dv" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dyo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/dz" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ebu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ee" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/el" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/en" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/eo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/es" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/et" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/eu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ewo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fa" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ff" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fil" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fur" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/fy" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ga" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/gd" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/gl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/gsw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/gu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/guw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/guz" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/gv" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ha" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/haw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/he" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/hi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/hr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/hsb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/hu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/hy" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/id" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ig" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ii" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/in" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/is" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/it" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/iu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/iw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ja" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/jbo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/jgo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ji" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/jmc" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/jv" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/jw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ka" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kab" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kaj" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kam" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kcg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kde" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kea" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/khq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ki" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kkj" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kln" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/km" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ko" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kok" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ks" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ksb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ksf" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ksh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ku" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/kw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ky" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lag" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lkt" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ln" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lrc" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lt" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/luo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/luy" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/lv" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mas" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mer" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mfe" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mgh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mgo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ml" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ms" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mt" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mua" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/my" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/mzn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nah" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/naq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nb" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nd" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ne" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nmg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nnh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/no" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nqo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nso" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nus" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ny" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/nyn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/om" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/or" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/os" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/pa" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/pap" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/pl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/prg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ps" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/pt" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/qu" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/rm" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/rn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ro" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/rof" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ru" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/rw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/rwk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sah" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/saq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sbp" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sdh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/se" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/seh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ses" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sg" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/shi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/si" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sma" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/smi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/smj" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/smn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sms" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/so" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ss" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ssy" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/st" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sv" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/sw" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/syr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ta" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/te" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/teo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/th" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ti" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tig" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tl" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tn" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/to" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tr" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ts" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/twq" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/tzm" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ug" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/uk" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ur" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/uz" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/vai" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/ve" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/vi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/vo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/vun" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/wa" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/wae" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/wo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/xh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/xog" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/yav" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/yi" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/yo" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/zgh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/zh" { + var data: ReactIntl.LocaleData; + export = data; +} + +declare module "react-intl/locale-data/zu" { var data: ReactIntl.LocaleData; export = data; } diff --git a/react-select/react-select-tests.tsx b/react-select/react-select-tests.tsx index 444551a675..b5258d85ca 100644 --- a/react-select/react-select-tests.tsx +++ b/react-select/react-select-tests.tsx @@ -1,30 +1,70 @@ - /// /// /// -import * as React from "react" -import * as ReactDOM from "react-dom" +import * as React from "react"; +import * as ReactDOM from "react-dom"; -import * as Select from "react-select" +import * as Select from "react-select"; class SelectTest extends React.Component, {}> { render() { - const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }] + const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }]; + const onChange = (value: any) => console.log(value); + const onOpen = () => { return; }; + const onClose = () => { return; }; + const optionRenderer = (option: ReactSelect.Option) => {option.label} return
    - +
    ; } - } class SelectAsyncTest extends React.Component, {}> { render() { + const getOptions = (input: string, callback: Function) => { + setTimeout(function() { + callback(null, options); + }, 500); + }; + const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }]; + const onChange = (value: any) => console.log(value); return
    - -
    + + ; } } diff --git a/react-select/react-select.d.ts b/react-select/react-select.d.ts index c9e385a159..05056d198e 100644 --- a/react-select/react-select.d.ts +++ b/react-select/react-select.d.ts @@ -6,6 +6,7 @@ /// declare namespace ReactSelect { + interface Option { /** Text for rendering */ label: string; @@ -153,13 +154,16 @@ declare namespace ReactSelect { */ onBlurResetsInput?: boolean; onChange?: (newValue: Option | Option[]) => void; + onClose?: () => void; onFocus?: __React.FocusEventHandler; onInputChange?: (inputValue: string) => void; + onOpen?: () => void; onOptionLabelClick?: (value: string, event: Event) => void; + /** * function which returns a custom way to render the options in the menu */ - optionRenderer?: () => void; + optionRenderer?: (option: Option) => JSX.Element; /** * array of Select options * @default false @@ -199,23 +203,104 @@ declare namespace ReactSelect { * @default false */ valueRenderer?: () => void; + /** + * optional style to apply to the control + */ + style?: any; + + /** + * optional tab index of the control + */ + tabIndex?: string; + + /** + * value component to render + */ + valueComponent?: Function; + + /** + * optional style to apply to the component wrapper + */ + wrapperStyle?: any; + + /** + * onClick handler for value labels: function (value, event) {} + */ + onValueClick?: Function; + + /** + * pass the value to onChange as a simple value (legacy pre 1.0 mode), defaults to false + */ + simpleValue?: boolean; } - interface ReactAsyncSelectProps extends __React.Props { + interface ReactAsyncSelectProps extends ReactSelectProps { + /** + * object to use to cache results; can be null to disable cache + */ cache?: any; - loadOptions?: () => void; + + /** + * whether to strip diacritics when filtering (shared with Select) + */ ignoreAccents?: boolean; + + /** + * whether to perform case-insensitive filtering (shared with Select) + */ + ignoreCase?: boolean; + + /** + * overrides the isLoading state when set to true + */ isLoading?: boolean; + + /** + * function to call to load options asynchronously + */ + loadOptions: (input: string, callback: (options: Option[]) => any) => any; + + /** + * replaces the placeholder while options are loading + */ loadingPlaceholder?: string; + + /** + * the minimum number of characters that trigger loadOptions + */ + minimumInput?: number; + + /** + * placeholder displayed when there are no matching search results (shared with Select) + */ + noResultsText?: string; + /** + * field placeholder; displayed when there's no value (shared with Select) + */ + placeholder?: string; + + /** + * label to prompt for search input + */ + searchPromptText?: string; + + /** + * message to display while options are loading + */ + searchingText?: string; } interface ReactSelect extends __React.ReactElement { } - interface ReactSelectClass extends __React.ComponentClass { - Async: __React.ComponentClass; + interface ReactSelectAsyncClass extends __React.ComponentClass { } + const Async: ReactSelectAsyncClass; + interface ReactSelectClass extends __React.ComponentClass { + Async: ReactSelectAsyncClass; + } + } declare module "react-select" { - var select: ReactSelect.ReactSelectClass; + const select: ReactSelect.ReactSelectClass; export = select; } diff --git a/react-tagcloud/react-tagcloud-tests.tsx b/react-tagcloud/react-tagcloud-tests.tsx new file mode 100644 index 0000000000..76a0328670 --- /dev/null +++ b/react-tagcloud/react-tagcloud-tests.tsx @@ -0,0 +1,102 @@ +/// +/// +/// + + +// simple cloud +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import {TagCloud, DefaultRenderer} from "react-tagcloud"; + +let data = [ + { value: "jQuery", count: 25 }, { value: "MongoDB", count: 18 }, + { value: "JavaScript", count: 38 }, { value: "React", count: 30 }, + { value: "Nodejs", count: 28 }, { value: "Express.js", count: 25 }, + { value: "HTML5", count: 33 }, { value: "CSS3", count: 20 } +]; + +ReactDOM.render( + // minSize, maxSize - font size in px + // tags - array of objects with properties value and count + // shuffle - indicates if data should be shuffled (true by default) + // onClick event handler has `tag` and `event` parameter + console.log("clicking on tag:", tag)} />, + document.getElementById("simple-cloud") +); + + + +// default-renderer + +// DefaultRenderer creates default renderer implementation with custom options +// usage of tagRenderer option is described in ./custom-tag-renderer.js + +// custom props will be applied on each tag component +const props = { + style: {border: "1px solid silver", padding: "5px"}, + className: "my-tag-class" +}; + +// custom random color options +// see randomColor package: https://github.com/davidmerfield/randomColor +const colorOptions = { + luminosity: "light", + hue: "blue" +}; + +let customizedDefaultRenderer = new DefaultRenderer({ props, colorOptions }); + +ReactDOM.render( + , + document.getElementById("default-renderer") +); +// +// custom-renderer.js +// using custom renderer the default renderer will be overriden + +// custom renderer is function which takes tag, computed font size and +// elemnt key as arguments, and returns react component +let customRenderer2 = (tag: any, size: number, key: string|number) => { + return {tag.value}; +}; + +ReactDOM.render( + , + document.getElementById("custom-renderer") +); + + +// example from custom-tag-renderer.js +let data2 = [ + { value: { name: "google", link: "http://google.com" }, count: 25 }, + { value: { name: "yahoo", link: "http://yahoo.com" }, count: 18 }, + { value: { name: "facebook", link: "http://facebook.com" }, count: 38 }, + { value: { name: "twitter", link: "http://twitter.com" }, count: 30 }, + { value: { name: "github", link: "http://github.com" }, count: 28 }, + { value: { name: "npmjs", link: "http://npmjs.com" }, count: 25 }, + { value: { name: "stackoverflow", link: "http://stackoverflow.com" }, count: 33 } +]; + +// with tagRenderer option it is possible to customize rendering of each tag +// tagRender is a function which takes tag as argument and returns react component or simple string +const tagRenderer = (tag: any) => ({tag.value.name}); + +const customizedDefaultRenderer4 = new DefaultRenderer({ tagRenderer }); + +ReactDOM.render( + , + document.getElementById("custom-tag-renderer") +); diff --git a/react-tagcloud/react-tagcloud.d.ts b/react-tagcloud/react-tagcloud.d.ts new file mode 100644 index 0000000000..4049070893 --- /dev/null +++ b/react-tagcloud/react-tagcloud.d.ts @@ -0,0 +1,43 @@ +// Type definitions for react-tagcloud v0.4.0 +// Project: https://github.com/madox2/react-tagcloud +// Definitions by: wassname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ReactTagCloud { + interface TagCloudProps extends __React.Props { + tags: any[]; + maxSize: number; + minSize: number; + shuffle?: boolean; + renderer?: Function; + className?: string; + onClick?: Function; + } + interface TagCloudClass extends __React.ComponentClass { } + + interface DefaultRendererFactoryOptions { + tagRenderer?: Function; + colorOptions?: any; + props?: any; + } + interface RendererFunction { + (tag: any, size: number, key: string | number, handlers: any): any; + } + interface DefaultRendererFactory { + new (_ref?: DefaultRendererFactoryOptions): RendererFunction; + (_ref?: DefaultRendererFactoryOptions): RendererFunction; + } +} + + +// export = TagCloud +declare module reactTagCloud { + const TagCloud: ReactTagCloud.TagCloudClass; + const DefaultRenderer: ReactTagCloud.DefaultRendererFactory; +} + +declare module "react-tagcloud" { + export = reactTagCloud +} diff --git a/react-widgets/react-widgets-tests.tsx b/react-widgets/react-widgets-tests.tsx new file mode 100644 index 0000000000..f1d47a4211 --- /dev/null +++ b/react-widgets/react-widgets-tests.tsx @@ -0,0 +1,58 @@ + +/// +/// +/// + +import * as React from "react" +import * as ReactDOM from "react-dom" + +import { Calendar, Combobox, DateTimePicker, DropdownList, Multiselect, NumberPicker, SelectList } from "react-widgets" + +function tagComponent(props: { value: string }) { + return {props.value}; +} + +function itemComponent(props: { value: string }) { + return {props.value}; +} + +class Test extends React.Component, {}> { + + render() { + return ( +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + +
    +
    + ) + } + +} \ No newline at end of file diff --git a/react-widgets/react-widgets.d.ts b/react-widgets/react-widgets.d.ts new file mode 100644 index 0000000000..bbd81dd7c8 --- /dev/null +++ b/react-widgets/react-widgets.d.ts @@ -0,0 +1,963 @@ +// Type definitions for react-widgets v3.2.1 +// Project: https://github.com/jquense/react-widgets +// Definitions by: Rogier Schouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'react-widgets/lib/Combobox' { + + interface ComboBoxMessages { + /** + * Combobox button text for screen readers + */ + open: string | ((props: ComboBoxProps) => string); + /** + * text to display when the data prop array is empty + */ + emptyList: string | ((props: ComboBoxProps) => string); + /** + * text to display when the the current filter does not return any results + */ + emptyFilter: string | ((props: ComboBoxProps) => string); + } + + interface ComboBoxProps extends __React.Props { + /** + * The current value of the Combobox. This can be an object (such as a member of the data + * array) or a primitive value, hinted to by the valueField. The widget value does not need + * to be in the data, widgets can have values that are not in their list. + */ + value?: any; + /** + * Default value. + */ + defaultValue?: any; + /** + * Called when the value is changed. If the value is one of the data members that item will + * be returned. In the case of a value not being found in the data array the string value of + * the Combobox will be returned. + */ + onChange?: (value: any) => void; + /** + * This handler fires when an item has been selected from the list. It fires before the + * onChange handler, and fires regardless of whether the value has actually changed. + */ + onSelect?: (value: any) => void; + /** + * An array of possible values for the Combobox. If an array of objects is provided you + * should use the valueField and textField props, to specify which object properties + * comprise the value field (such as an id) and the field used to label the item. + */ + data?: any[]; + /** + * A dataItem field name for uniquely identifying items in the data list. A valueField is + * required when the value prop is not itself a dataItem. A valueField is useful when + * specifying the selected item, by its id instead of using the model as the value. When a + * valueField is not provided, the Combobox will use strict equality checks (===) to locate + * the value in the data list. + */ + valueField?: string; + /** + * Specify which data item field to display in the Combobox and selected item. The + * textField` prop may also also used as to find an item in the list as you type. Providing + * an accessor function allows for computed text values + */ + textField?: string; + /** + * This component is used to render each possible item in the Combobox. The default + * component renders the text of the selected item (specified by textfield) + */ + itemComponent?: __React.ReactType; + /** + * Disable the widget, if an Array of values is passed in only those values will be + * disabled. + */ + disabled?: boolean | any[]; + /** + * Place the Combobox in a read-only mode, If an Array of values is passed in only those + * values will be read-only. + */ + readOnly?: boolean | any[]; + /** + * Determines how to group the Combobox. Providing a string will group the data array by + * that property. You can also provide a function which should return the group value. + */ + groupBy?: string | ((dataItem: any) => any); + /** + * This component is used to render each option group, when groupBy is specified. By default + * the groupBy value will be used. + */ + groupComponent?: __React.ReactType; + /** + * When true the Combobox will suggest, or fill in, values as you type. The suggestions are + * always "startsWith", meaning it will search from the start of the textField property + */ + suggest?: boolean; + /** + * Specify a filtering method used to reduce the items in the dropdown as you type. It can + * be used in conjunction with the suggest prop or instead of it. There are a few built-in + * filtering methods that can be specified by passing the String name. You can explicitly + * opt out of filtering by setting filter to false To handle custom filtering techniques + * provide a function that returns true or false for each passed in item (analogous to the + * array.filter builtin) Acceptable values for filter are: false "startsWith" "endsWith" + * "contains" function(String item) + */ + filter?: boolean | string | ((dataItem: any, searchItem: any) => boolean); + /** + * Use in conjunction with the filter prop. Filter the list without regard for case. This + * only applies to non function values for filter + */ + caseSensitive?: boolean; + /** + * Use in conjunction with the filter prop. Start filtering the list only after the value + * has reached a minimum length. + */ + minLength?: number; + /** + * Whether or not the Combobox is open. When unset (undefined) the Combobox will handle the + * opening and closing internally. The defaultOpen prop can be used to set an initialization + * value for uncontrolled widgets. + */ + open?: boolean; + /** + * Called fires when the Combobox is about to open or close. onToggle should be used when + * the open prop is set otherwise the widget will never open or close. + */ + onToggle?: (isOpen: boolean) => void; + /** + * Mark whether the widget is in a busy or loading state. If true the widget will display a + * spinner gif, useful when loading data via an ajax call. + */ + busy?: boolean; + /** + * The speed, in milliseconds, of the dropdown animation. + */ + duration?: number; + /** + * mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: ComboBoxMessages; + } + + interface ComboBox extends __React.ReactElement {} + interface ComboBoxClass extends __React.ComponentClass {} + var ComboBox: ComboBoxClass; + export = ComboBox; +} + +declare module 'react-widgets/lib/DateTimePicker' { + + interface DateTimePickerProps extends __React.Props { + /** + * Whether to show the date picker button. + * @default true + */ + calendar?: boolean; + /** + * Whether to show the time picker button. + * @default true + */ + time?: boolean; + /** + * The minimum Date that can be selected. Min only limits selection, it doesn't constrain + * the date values that can be typed or pasted into the widget. If you need this behavior + * you can constrain values via the onChange handler. + * @default Date(1900, 0, 1) + */ + min?: Date; + /** + * The maximum Date that can be selected. Max only limits selection, it doesn't constrain + * the date values that can be typed or pasted into the widget. If you need this behavior + * you can constrain values via the onChange handler. + * @default Date(2099, 11, 31) + */ + max?: Date; + /** + * Default current date at which the calendar opens. If none is provided, opens at today's + * date or the value date (if any). + * @default Date() + */ + currentDate?: Date; + /** + * Change event Handler that is called when the currentDate is changed. The handler is + * called with the currentDate object. + */ + onCurrentDateChange?: (date?: Date) => void; + /** + * A string format used to display the date value. + */ + format?: string; + /** + * A string format to be used while the date input has focus. Useful for showing a simpler + * format for inputing. + */ + editFormat?: string; + /** + * A string format used by the time dropdown to render times. + */ + timeFormat?: string; + /** + * The amount of minutes between each entry in the time list. + */ + step?: number | boolean; + /** + * Determines how the widget parses the typed date string into a Date object. You can + * provide an array of formats to try, or provide a function that returns a date to handle + * parsing yourself. When parse is unspecified and the format prop is a String parse will + * automatically use that format as its default + */ + parse?: (str: string) => Date | string[]; + /** + * The starting and lowest level view the calendar can navigate down to. + * @enum "month" "year" "decade" "century" + */ + initialView?: "month" | "year" | "decade" | "century"; + /** + * The highest level view the calendar can navigate up to. This value should be higher than + * initialView. + * @enum "month" "year" "decade" "century" + */ + finalView?: "month" | "year" | "decade" | "century"; + /** + * The current selected date, should be a Date instance or null. + */ + value?: Date; + /** + * Default value. + */ + defaultValue?: Date; + /** + * Change event Handler that is called when the value is changed. The handler is called with + * both the current Date object (or null if it was not parseable), and the second argument + * is a string representation of the date value, formated by the format prop. + */ + onChange?: (date?: Date, dateStr?: string) => void; + /** + * This handler fires when an item has been selected from the list or calendar. It fires + * before the onChange handler, and fires regardless of whether the value has actually + * changed. + */ + onSelect?: (date?: Date) => void; + /** + * Whether or not the DateTimePicker is open. When unset (undefined) the DateTimePicker will + * handle the opening and closing internally. The defaultOpen prop can be used to set an + * initialization value for uncontrolled widgets. + * @enum false "calendar" "time" + */ + open?: boolean | "calendar" | "time"; + /** + * Called when the DateTimePicker is about to open or close. onToggle should be used when + * the open prop is set otherwise the widget will never open or close. + */ + onToggle?: (isOpen: boolean) => void; + /** + * The speed, in milliseconds, of the either dropdown animation. + */ + duration?: number; + /** + * Mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: DateTimePickerMessages; + } + + interface DateTimePickerMessages { + /** + * Title and screen reader text for the left arrow button. + * @default "Select Date" + */ + calendarButton?: string; + /** + * Title and screen reader text for the right arrow button. + * @default "Select Time" + */ + timeButton?: string; + } + + interface DateTimePicker extends __React.ReactElement {} + interface DateTimePickerClass extends __React.ComponentClass {} + var DateTimePicker: DateTimePickerClass; + export = DateTimePicker; +} + +declare module 'react-widgets/lib/Multiselect' { + interface MultiselectProps extends __React.Props { + /** + * The current values of the Multiselect. The value should can null, or an array of + * valueField values, or an array of objects (such as a few items in the data array) + */ + value?: any[]; + /** + * Default Value. + */ + defaultValue?: any[]; + /** + * Change event Handler that is called when the value is changed. The handler is called with + * an array of values. + */ + onChange?: (values: any[]) => void; + /** + * This handler fires when an item has been selected from the list. It fires before the + * onChange handler, and fires regardless of whether the value has actually changed + */ + onSelect?: (value: any) => void; + /** + * This handler fires when the user chooses to create a new tag, not in the data list. It is + * up to the widget parent to implement creation logic, a common implementation is shown + * below, where the new tag is selected and added to the data list. + */ + onCreate?: (searchTerm: string) => void; + /** + * Provide an array of possible values for the Multiselect. If an array of objects is + * provided you should use the valueField and textField props, to specify which object + * properties comprise the value field (such as an id) and the field used to label the item. + */ + data?: any[]; + /** + * A dataItem field name for uniquely identifying items in the data list. A valueField is + * required when the value prop is not itself a dataItem. A valueField is useful when + * specifying the selected item, by its id instead of using the model as the value. + * When a valueField is not provided, the Multiselect will use strict equality checks (===) + * to locate the value in the data list. + */ + valueField?: string; + /** + * Specify which data item field to display in the Multiselect and selected item. The + * textField prop may also also used as to find an item in the list as you type. Providing + * an accessor function allows for computed text values. + */ + textField?: string | ((dataItem: any) => string); + /** + * This component is used to render each selected item. The default component renders the + * text of the selected item (specified by textfield). + */ + tagComponent?: __React.ReactType; + /** + * This component is used to render each possible item in the list. The default component + * renders the text of the selected item (specified by textfield). + */ + itemComponent?: __React.ReactType; + /** + * Determines how to group the Multiselect values. Providing a string will group the data + * array by that property. You can also provide a 'function' which should return the group + * value. + */ + groupBy?: string | ((dataItem: any) => any); + /** + * This component is used to render each option group, when groupBy is specified. By default + * the groupBy value will be used. + */ + groupComponent?: __React.ReactType; + /** + * The same as an input placeholder, only works in browsers that support the placeholder + * attribute for inputs + */ + placeholder?: string; + /** + * The string value of the current search being typed into the Multiselect. When unset + * (undefined) the Multiselect will handle the filtering internally. The defaultSearchTerm + * prop can be used to set an initialization value for uncontrolled widgets. + */ + searchTerm?: string; + /** + * Called when the value of the text box changes either from typing or a pasted value. + * onSearch should be used when the searchTerm prop is set. + */ + onSearch?: (searchTerm: string) => void; + /** + * Whether or not the Multiselect is open. When unset (undefined) the Multiselect will + * handle the opening and closing internally. The defaultOpen prop can be used to set an + * initialization value for uncontrolled widgets. + */ + open?: boolean; + /** + * Called when the Multiselect is about to open or close. onToggle should be used when the + * open prop is set otherwise the widget will never open or close. + */ + onToggle?: (isOpen: boolean) => void; + /** + * Specify a filtering method used to reduce the items in the dropdown as you type. There + * are a few built-in filtering methods that can be specified by passing the String name. + * You can explicitly opt out of filtering by setting filter to false. To handle custom + * filtering techniques provide a function that returns true or false for each passed in + * item (analogous to the array.filter builtin) + * @enum false "startsWith" "endsWith" "contains" function(String item) + * @default startsWith + */ + filter?: boolean | "startsWith" | "endsWith" | "contains" | ((dataItem: any, searchTerm: string) => boolean); + /** + * Use in conjunction with the filter prop. Filter the list without regard for case. This + * only applies to non function values for filter. + * @default false + */ + caseSensitive?: boolean; + /** + * Use in conjunction with the filter prop. Start filtering the list only after the value + * has reached a minimum length. + * @default 1 + */ + minLength?: number; + /** + * mark whether the widget is in a busy or loading state. If true the widget will display a + * spinner gif, useful when loading data via an ajax call. + * @default false + */ + busy?: boolean; + /** + * The speed, in milliseconds, of the dropdown animation. + * @default 250 + */ + duration?: number; + /** + * Disable the widget, If an Array of values is passed in only the tags specified will be + * disabled. + */ + disabled?: boolean | any[]; + /** + * Place the widget in a readonly mode, If an Array of values is passed in only the tags + * specified will be readonly. + */ + readOnly?: boolean | any[]; + /** + * Mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + * @default false + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: MultiselectMessages; + } + + interface MultiselectMessages { + /** + * The text label for creating new tags. + * @default "(create new tag)" + */ + createNew?: string | ((props: MultiselectProps) => string); + /** + * Text to display when the data prop array is empty. + * @default "There are no items in this list" + */ + emptyList?: string | ((props: MultiselectProps) => string); + /** + * Text to display when the the current filter does not return any results. + * @default "The filter returned no results" + */ + emptyFilter?: string | ((props: MultiselectProps) => string); + } + + interface Multiselect extends __React.ReactElement {} + interface MultiselectClass extends __React.ComponentClass {} + var Multiselect: MultiselectClass; + export = Multiselect; +} + +declare module 'react-widgets/lib/NumberPicker' { + interface NumberPickerProps extends __React.Props{ + /** + * The current value of the NumberPicker. + */ + value?: number; + /** + * Default Value. + */ + defaultValue?: number; + /** + * Change event Handler that is called when the value is changed. The handler is called with + * the current numeric value or null. + */ + onChange?: (value?: number) => void; + /** + * A format string used to display the number value. Localizer dependent, read localization + * for more info. + * @see http://jquense.github.io/react-widgets/docs/#i18n + */ + format?: any; + /** + * Determines how the NumberPicker parses a number from the localized string representation. + * You can also provide a parser Function to pair with a custom format. + */ + parse?: string[] | ((str: string, culture: string) => number); + /** + * The minimum number that the NumberPicker value. + * @default -Infinity + */ + min?: number; + /** + * The maximum number that the NumberPicker value. + * @default Infinity + */ + max?: number; + /** + * Amount to increase or decrease value when using the spinner buttons. + * @default 1 + */ + step?: number; + /** + * Specify how precise the value should be when typing, incrementing, or decrementing the + * value. When empty, precision is parsed from the current format and culture. + */ + precision?: number; + /** + * Mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + * @default false + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: NumberPickerMessages; + } + + interface NumberPickerMessages { + /** + * Number picker spinner up button text for screen readers. + * @default "increment value" + */ + increment?: string; + /** + * Number picker spinner down button text for screen readers. + * @default "decrement value" + */ + decrement?: string; + } + + interface NumberPicker extends __React.ReactElement {} + interface NumberPickerClass extends __React.ComponentClass {} + var NumberPicker: NumberPickerClass; + export = NumberPicker; +} + +declare module 'react-widgets/lib/SelectList' { + interface SelectListProps extends __React.Props{ + /** + * The current value or values of the SelectList. This can be an object (such as a member of + * the data array) or a primitive value, hinted to by the valueField. The widget value does + * not need to be in the data array; widgets can have values that are not in their list. + */ + value?: any | any[]; + /** + * Default Value. + */ + defaultValue?: any | any[]; + /** + * Change event handler that is called when the value is changed. values will be an array + * when multiple prop is set. + */ + onChange?: (values: any | any[]) => void; + /** + * Provide an array of possible values for the SelectList. If an array of objects is + * provided you should use the valueField and textField props, to specify which object + * properties comprise the value field (such as an id) and the field used to label the item. + */ + data?: any[]; + /** + * A dataItem field name for uniquely identifying items in the data list. A valueField is + * required when the value prop is not itself a dataItem. A valueField is useful when + * specifying the selected item, by its id instead of using the model as the value. + * When a valueField is not provided, the SelectList will use strict equality checks (===) + * to locate the value in the data list. + */ + valueField?: string; + /** + * Specify which data item field to display in the SelectList and selected item. The + * textField prop may also also used as to find an item in the list as you type. Providing + * an accessor function allows for computed text values. + */ + textField?: string | ((dataItem: any) => string); + /** + * Whether or not the SelectList allows multiple selection or not. when false the SelectList + * will render as a list of radio buttons, and checkboxes when true. + */ + multiple?: boolean; + /** + * This component is used to render each item in the SelectList. The default component + * renders the text of the selected item (specified by textfield) + */ + itemComponent?: __React.ReactType; + /** + * Determines how to group the SelectList dropdown list. Providing a string will group the + * data array by that property. You can also provide a 'function' which should return the + * group value. + */ + groupBy?: string | ((dataItem: any) => any); + /** + * This component is used to render each option group, when groupBy is specified. By default + * the groupBy value will be used. + */ + groupComponent?: __React.ReactType; + /** + * A handler called when focus shifts on the SelectList. Internally this is used to ensure + * the focused item is in view. If you want to define your own "scrollTo" behavior or just + * disable the default one specify an onMove handler. The handler is called with the + * relevant DOM nodes needed to implement scroll behavior: the list element, the element + * that is currently focused, and a focused value. + */ + onMove?: (list: HTMLElement, focusedNode: HTMLElement, focusedItem: any) => void; + /** + * Mark whether the widget is in a busy or loading state. If true the widget will display a + * spinner gif, useful when loading data via an ajax call. + * @default false + */ + busy?: boolean; + /** + * Disable the widget, if an Array of values is passed in only those values will be + * disabled. + */ + disabled?: boolean | any[]; + /** + * Place the SelectList in a read-only mode, If an Array of values is passed in only those + * values will be read-only. + */ + readOnly?: boolean | any[]; + /** + * Mark whether the SelectList should render right-to-left. This property can also be + * implicitly passed to the widget through a childContext prop (isRtl) this allows higher + * level application components to specify the direction. + * @default false + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: SelectListMessages; + } + interface SelectListMessages { + /** + * @default: "There are no items in this list" + */ + emptyList?: string | ((props: SelectListProps) => string) + } + + interface SelectList extends __React.ReactElement {} + interface SelectListClass extends __React.ComponentClass {} + var SelectList: SelectListClass; + export = SelectList; +} + +declare module 'react-widgets/lib/Calendar' { + interface CalendarProps extends __React.Props{ + /** + * The current selected date, should be a Date object or null. + */ + value?: Date; + /** + * Default value. + */ + defaultValue?: Date; + /** + * Change event Handler that is called when the value is changed. The handler is called with + * the Date object + */ + onChange?: (date?: Date) => void; + /** + * Callback fired when the Calendar navigates between views, or forward and backwards in + * time. + */ + onNavigate?: (date: Date, direction: string, view: string ) => void; + /** + * The minimum date that the Calendar can navigate from. + */ + min?: Date; + /** + * The maximum date that the Calendar can navigate to. + */ + max?: Date; + /** + * Default current date at which the calendar opens. If none is provided, opens at today's + * date or the value date (if any). + * @default Date() + */ + currentDate?: Date; + /** + * Change event Handler that is called when the currentDate is changed. The handler is + * called with the currentDate object. + */ + onCurrentDateChange?: (date?: Date) => void; + /** + * Show or hide the Calendar footer. + * @default false + */ + footer?: boolean; + /** + * Provide a custom component to render the days of the month. + * The Component is provided the following props + * - date: a Date object for the day of the month to render + * - label: a formatted String of the date to render. To adjust the format of the label + * string use the dateFormat prop, listed below. + */ + dayComponent?: __React.ReactType; + /** + * The starting and lowest level view the calendar can navigate down to. + * @enum "month" "year" "decade" "century" + */ + initialView?: "month" | "year" | "decade" | "century"; + /** + * The highest level view the calendar can navigate up to. This value should be higher than + * initialView + * @enum "month" "year" "decade" "century" + */ + finalView?: "month" | "year" | "decade" | "century"; + /** + * A formatter for the header button of the month view + */ + headerFormat?: string | ((day: Date) => string); + /** + * A formatter for the Calendar footer, formats Today's Date as a string. + */ + footerFormat?: string | ((day: Date) => string); + /** + * A formatter calendar days of the week, the default formats each day as a Narrow name: + * "Mo", "Tu", etc. + */ + dayFormat?: string | ((day: Date) => string); + /** + * A formatter for day of the month. + */ + dateFormat?: string | ((day: Date) => string); + /** + * A formatter for month name. + */ + monthFormat?: string | ((day: Date) => string); + /** + * A formatter for the year. + */ + yearFormat?: string | ((day: Date) => string); + /** + * A formatter for decade, the default formats the first and last year of the decade like: + * 2000 - 2009. + */ + decadeFormat?: string | ((day: Date) => string); + /** + * A formatter for century, the default formats the first and last year of the century like: + * 1900 - 1999. + */ + centuryFormat?: string | ((day: Date) => string); + /** + * Mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + */ + isRtl?: boolean; + messages?: CalendarMessages; + } + + interface CalendarMessages { + /** + * Title and screen reader text for the left arrow button. + * @default: "navigate back" + */ + moveBack?: string; + /** + * Title and screen reader text for the right arrow button. + * @default: "navigate forward" + */ + moveForward?: string; + } + + interface Calendar extends __React.ReactElement {} + interface CalendarClass extends __React.ComponentClass {} + var Calendar: CalendarClass; + export = Calendar; +} + +declare module 'react-widgets/lib/DropdownList' { + interface DropdownListProps extends __React.Props { + /** + * The current value of the DropdownList. This can be an object (such as a member of the + * data array) or a primitive value, hinted to by the valueField. The widget value does not + * need to be in the data array; widgets can have values that are not in their list. + */ + value?: any; + /** + * Default value. + */ + defaultValue?: any; + /** + * Change event Handler that is called when the value is changed. + */ + onChange?: (value: any) => void; + /** + * This handler fires when an item has been selected from the list. It fires before the + * onChange handler, and fires regardless of whether the value has actually changed. + */ + onSelect?: (value: any) => void; + /** + * Provide an array of possible values for the DropdownList. If an array of objects is + * provided you should use the valueField and textField props, to specify which object + * properties comprise the value field (such as an id) and the field used to label the item. + */ + data?: any[]; + /** + * A dataItem field name for uniquely identifying items in the data list. A valueField is + * required when the value prop is not itself a dataItem. A valueField is useful when + * specifying the selected item, by its id instead of using the model as the value. + * When a valueField is not provided, the DropdownList will use strict equality checks (===) + * to locate the value in the data list. + */ + valueField?: string; + /** + * Specify which data item field to display in the DropdownList and selected item. + * ThetextFieldprop may also also used as to find an item in the list as you type. Providing + * an accessor function allows for computed text values + */ + textField?: string; + /** + * This component is used to render the selected value of the DropdownList. The default + * component renders the text of the selected item (specified by textfield) + */ + valueComponent?: __React.ReactType; + /** + * This component is used to render each possible item in the DropdownList. The default + * component renders the text of the selected item (specified by textfield) + */ + itemComponent?: __React.ReactType; + /** + * Disable the widget, if an Array of values is passed in only those values will be disabled. + */ + disabled?: boolean | any[]; + /** + * Place the DropdownList in a read-only mode, If an Array of values is passed in only those + * values will be read-only. + */ + readOnly?: boolean | any[]; + /** + * Determines how to group the DropdownList. Providing a string will group the data array by + * that property. You can also provide a function which should return the group value. + */ + groupBy?: string | ((dataItem: any) => any); + /** + * This component is used to render each option group, when groupBy is specified. By default + * the groupBy value will be used. + */ + groupComponent?: __React.ReactType; + /** + * Text to display when the value is empty. + */ + placeholder?: string; + /** + * The string value of the current search being typed into the DropdownList. When unset + * (undefined) the DropdownList will handle the filtering internally. The defaultSearchTerm + * prop can be used to set an initialization value for uncontrolled widgets. searchTerm is + * only relevant when the filter prop is set. + */ + searchTerm?: string; + /** + * Called when the value of the filter input changes either from typing or a pasted value. + * onSearch should be used when the searchTerm prop is set. + */ + onSearch?: (searchTerm: string) => void; + /** + * Whether or not the DropdownList is open. When unset (undefined) the DropdownList will + * handle the opening and closing internally. The defaultOpen prop can be used to set an + * initialization value for uncontrolled widgets. + */ + open?: boolean; + /** + * Called when the DropdownList is about to open or close. onToggle should be used when the + * open prop is set otherwise the widget open buttons won't work. + */ + onToggle?: (isOpen: boolean) => void; + /** + * Specify a filtering method used to reduce the items in the dropdown as you type. + * There are a few built-in filtering methods that can be specified by passing the String name. + * To handle custom filtering techniques provide a function that returns true or false + * for each passed in item (analogous to the array.filter builtin) + * @enum false "startsWith" "endsWith" "contains" + */ + filter?: boolean | "startsWith" | "endsWith" | "contains" | ((dataItem: any, str: string) => boolean); + /** + * Use in conjunction with the filter prop. Filter the list without regard for case. This + * only applies to non function values for filter + * @default false + */ + caseSensitive?: boolean; + /** + * Use in conjunction with the filter prop. Start filtering the list only after the value + * has reached a minimum length. + * @default 1 + */ + minLength?: number; + /** + * Mark whether the widget is in a busy or loading state. If true the widget will display a + * spinner gif, useful when loading data via an ajax call. + * @default false + */ + busy?: boolean; + /** + * The speed, in milliseconds, of the dropdown animation. + * @default 250 + */ + duration?: number; + /** + * Mark whether the widget should render right-to-left. This property can also be implicitly + * passed to the widget through a childContext prop (isRtl) this allows higher level + * application components to specify the direction. + */ + isRtl?: boolean; + /** + * Object hash containing display text and/or text for screen readers. Use the messages + * object to localize widget text and increase accessibility. + */ + messages?: DropdownListMessages; + } + + interface DropdownListMessages { + /** + * Dropdown button text for screen readers. + * @default: "Open Dropdown" + */ + open?: string | ((props: DropdownListProps) => string); + /** + * The placeholder text for the filter input. + */ + filterPlaceholder?: string | ((props: DropdownListProps) => string); + /** + * Text to display when the data prop array is empty. + * @default: "There are no items in this list" + */ + emptyList?: string | ((props: DropdownListProps) => string); + /** + * Text to display when the the current filter does not return any results. + * @default: "The filter returned no results" + */ + emptyFilter?: string | ((props: DropdownListProps) => string); + } + + interface DropdownList extends __React.ReactElement {} + interface DropdownListClass extends __React.ComponentClass {} + var DropdownList: DropdownListClass; + export = DropdownList; +} + +declare module 'react-widgets' { + export import Calendar = require('react-widgets/lib/Calendar'); + export import Combobox = require('react-widgets/lib/Combobox'); + export import DateTimePicker = require('react-widgets/lib/DateTimePicker'); + export import DropdownList = require('react-widgets/lib/DropdownList'); + export import Multiselect = require('react-widgets/lib/Multiselect'); + export import NumberPicker = require('react-widgets/lib/NumberPicker'); + export import SelectList = require('react-widgets/lib/SelectList'); +} diff --git a/react/react-addons-test-utils.d.ts b/react/react-addons-test-utils.d.ts index 76056caf30..8bf50366e9 100644 --- a/react/react-addons-test-utils.d.ts +++ b/react/react-addons-test-utils.d.ts @@ -62,6 +62,7 @@ declare namespace __React { export var blur: EventSimulator; export var change: EventSimulator; export var click: EventSimulator; + export var copy: EventSimulator; export var cut: EventSimulator; export var doubleClick: EventSimulator; export var drag: EventSimulator; diff --git a/react/react-addons-transition-group.d.ts b/react/react-addons-transition-group.d.ts index ca7bb4c31e..f63816220f 100644 --- a/react/react-addons-transition-group.d.ts +++ b/react/react-addons-transition-group.d.ts @@ -9,6 +9,7 @@ declare namespace __React { interface TransitionGroupProps { component?: ReactType; + className?: string; childFactory?: (child: ReactElement) => ReactElement; } diff --git a/react/react-dom.d.ts b/react/react-dom.d.ts index c95f64518b..1f6ca6efd4 100644 --- a/react/react-dom.d.ts +++ b/react/react-dom.d.ts @@ -18,14 +18,14 @@ declare namespace __React { element: SFCElement

    , container: Element, callback?: () => any): void; - function render>( + function render>( element: CElement, container: Element, callback?: (component: T) => any): T; function render

    ( element: ReactElement

    , container: Element, - callback?: (component?: Component | Element) => any): Component | Element | void; + callback?: (component?: Component | Element) => any): Component | Element | void; function unmountComponentAtNode(container: Element): boolean; @@ -40,7 +40,7 @@ declare namespace __React { element: DOMElement, container: Element, callback?: (element: T) => any): T; - function unstable_renderSubtreeIntoContainer>( + function unstable_renderSubtreeIntoContainer>( parentComponent: Component, element: CElement, container: Element, @@ -54,7 +54,7 @@ declare namespace __React { parentComponent: Component, element: ReactElement

    , container: Element, - callback?: (component?: Component | Element) => any): Component | Element | void; + callback?: (component?: Component | Element) => any): Component | Element | void; } namespace __DOMServer { diff --git a/react/react-tests.ts b/react/react-tests.ts index e0d9bb7be7..dc0a409dcf 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -138,6 +138,8 @@ class ModernComponent extends React.Component } } +class ModernComponentNoState extends React.Component {} + interface SCProps { foo?: number; } @@ -182,6 +184,8 @@ var domFactoryElement: React.DOMElement = // React.createElement var element: React.CElement = React.createElement(ModernComponent, props); +var elementNoState: React.CElement = + React.createElement(ModernComponentNoState, props); var statelessElement: React.SFCElement = React.createElement(StatelessComponent, props); var classicElement: React.ClassicElement = @@ -216,6 +220,8 @@ var clonedDOMElement: React.ReactHTMLElement = // React.render var component: ModernComponent = ReactDOM.render(element, container); +var componentNoState: ModernComponentNoState = + ReactDOM.render(elementNoState, container); var classicComponent: React.ClassicComponent = ReactDOM.render(classicElement, container); var domComponent: Element = diff --git a/react/react.d.ts b/react/react.d.ts index 04939558b5..bfc465c86f 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -13,6 +13,7 @@ declare namespace __React { type Key = string | number; type Ref = string | ((instance: T) => any); + type ComponentState = {} | void; interface Attributes { key?: Key; @@ -31,13 +32,13 @@ declare namespace __React { type: SFC

    ; } - type CElement> = ComponentElement; - interface ComponentElement> extends ReactElement

    { + type CElement> = ComponentElement; + interface ComponentElement> extends ReactElement

    { type: ComponentClass

    ; ref?: Ref; } - type ClassicElement

    = CElement>; + type ClassicElement

    = CElement>; interface DOMElement

    extends ReactElement

    { type: string; @@ -62,12 +63,12 @@ declare namespace __React { (props?: P & Attributes, ...children: ReactNode[]): SFCElement

    ; } - interface ComponentFactory> { + interface ComponentFactory> { (props?: P & ClassAttributes, ...children: ReactNode[]): CElement; } - type CFactory> = ComponentFactory; - type ClassicFactory

    = CFactory>; + type CFactory> = ComponentFactory; + type ClassicFactory

    = CFactory>; interface DOMFactory

    { (props?: P & ClassAttributes, ...children: ReactNode[]): DOMElement; @@ -101,8 +102,8 @@ declare namespace __React { type: string): DOMFactory; function createFactory

    (type: SFC

    ): SFCFactory

    ; function createFactory

    ( - type: ClassType, ClassicComponentClass

    >): CFactory>; - function createFactory, C extends ComponentClass

    >( + type: ClassType, ClassicComponentClass

    >): CFactory>; + function createFactory, C extends ComponentClass

    >( type: ClassType): CFactory; function createFactory

    (type: ComponentClass

    | SFC

    ): Factory

    ; @@ -115,10 +116,10 @@ declare namespace __React { props?: P & Attributes, ...children: ReactNode[]): SFCElement

    ; function createElement

    ( - type: ClassType, ClassicComponentClass

    >, - props?: P & ClassAttributes>, - ...children: ReactNode[]): CElement>; - function createElement, C extends ComponentClass

    >( + type: ClassType, ClassicComponentClass

    >, + props?: P & ClassAttributes>, + ...children: ReactNode[]): CElement>; + function createElement, C extends ComponentClass

    >( type: ClassType, props?: P & ClassAttributes, ...children: ReactNode[]): CElement; @@ -135,7 +136,7 @@ declare namespace __React { element: SFCElement

    , props?: Q, // should be Q & Attributes, but then Q is inferred as {} ...children: ReactNode[]): SFCElement

    ; - function cloneElement

    >( + function cloneElement

    >( element: CElement, props?: Q, // should be Q & ClassAttributes ...children: ReactNode[]): CElement; @@ -201,7 +202,7 @@ declare namespace __React { } interface ComponentClass

    { - new(props?: P, context?: any): Component; + new(props?: P, context?: any): Component; propTypes?: ValidationMap

    ; contextTypes?: ValidationMap; childContextTypes?: ValidationMap; @@ -210,7 +211,7 @@ declare namespace __React { } interface ClassicComponentClass

    extends ComponentClass

    { - new(props?: P, context?: any): ClassicComponent; + new(props?: P, context?: any): ClassicComponent; getDefaultProps?(): P; } @@ -219,7 +220,7 @@ declare namespace __React { * a single argument, which is useful for many top-level API defs. * See https://github.com/Microsoft/TypeScript/issues/7234 for more info. */ - type ClassType, C extends ComponentClass

    > = + type ClassType, C extends ComponentClass

    > = C & (new() => T) & (new() => { props: P }); @@ -1180,7 +1181,7 @@ declare namespace __React { lineClamp?: number; /** - * Specifies the height of an inline block level element. + * Specifies the height of an inline block level element. */ lineHeight?: number | string; @@ -2033,7 +2034,7 @@ declare namespace __React { results?: number; security?: string; unselectable?: boolean; - + // Allows aria- and data- Attributes [key: string]: any; } diff --git a/rebass/rebass-tests.tsx b/rebass/rebass-tests.tsx new file mode 100644 index 0000000000..e933d3c43f --- /dev/null +++ b/rebass/rebass-tests.tsx @@ -0,0 +1,625 @@ +/// + +import * as React from "react"; +import { + Arrow + , Avatar + , Badge + , Banner + , Block + , Blockquote + , Breadcrumbs + , Button + , ButtonCircle + , ButtonOutline + , Card + , CardImage + , Checkbox + , Close + , Container + , Divider + , Donut + , DotIndicator + , Drawer + , Dropdown + , DropdownMenu + , Embed + , Fixed + , Footer + , Heading + , HeadingLink + , InlineForm + , Input + , Label + , LinkBlock + , Media + , Menu + , Message + , NavItem + , Overlay + , PageHeader + , Panel + , PanelFooter + , PanelHeader + , Pre + , Progress + , Radio + , Rating + , Section + , SectionHeader + , Select + , SequenceMap + , SequenceMapStep + , Slider + , Space + , Stat + , Switch + , Table + , Text + , Textarea + , Toolbar + , Tooltip +} from "rebass"; + +interface IconProps extends React.Props { + fill: string; + height: string; + name: string; + width: string; +} + +class Icon extends React.Component { + render() { + return

    ; + } +} + +class RebassTest extends React.Component<{}, {}> { + render() { + return
    + + + + +
    + + Rebass + + + + 0.2.0 + + + + Pill + + + + Pill + + + + Circular + + + + 4 + +
    + + + + Rebass + + + + + + + Block + + + Generic box for containing things + + + + +
    + In the sixteenth century, a series of common sizes developed among European typographers, and the series survived with little change and few additions for 400 years. […] Use the old familiar scale, or use new scales of your own devising, but limit yourself, at first, to a modest set of distinct and related intervals. +
    + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + Example Icon component from react-geomicons + +
    + +
    + + Button + + + Group + + +
    + + + + + Card + + + Cats like cards too + + + +
    + +
    + +
    + + +
    + + + + + Container + + +
    + + +
    + +
    + + + 9/16 + + + +
    + +
    + +
    + + + + + + Hello + + + Hi + + + + + +